Refine memory filtering and lexicon sources for focus entities
This commit is contained in:
@@ -30,7 +30,8 @@ function normalize(s) {
|
||||
* 1. store.json.characters.main — 已确认主要角色
|
||||
* 2. store.json.arcs[].name — 弧光对象
|
||||
* 3. context.name2 — 当前角色
|
||||
* 4. store.json.facts[].s — L3 事实主语
|
||||
* 4. store.json.events[].participants — L2 事件参与者
|
||||
* 5. L0 atoms edges.s/edges.t
|
||||
*
|
||||
* 硬约束:永远排除 normalize(context.name1)
|
||||
*
|
||||
@@ -64,11 +65,12 @@ export function buildEntityLexicon(store, context) {
|
||||
add(context.name2);
|
||||
}
|
||||
|
||||
// 4. L3 facts 主语
|
||||
const facts = store?.json?.facts || [];
|
||||
for (const f of facts) {
|
||||
if (f.retracted) continue;
|
||||
add(f.s);
|
||||
// 4. L2 events 参与者
|
||||
const events = store?.json?.events || [];
|
||||
for (const ev of events) {
|
||||
for (const p of (ev?.participants || [])) {
|
||||
add(p);
|
||||
}
|
||||
}
|
||||
|
||||
// 5. L0 atoms 的 edges.s/edges.t(新角色在 L2 总结前即可进入词典)
|
||||
@@ -118,9 +120,12 @@ export function buildDisplayNameMap(store, context) {
|
||||
|
||||
if (context?.name2) register(context.name2);
|
||||
|
||||
const facts = store?.json?.facts || [];
|
||||
for (const f of facts) {
|
||||
if (!f.retracted) register(f.s);
|
||||
// 4. L2 events 参与者
|
||||
const events = store?.json?.events || [];
|
||||
for (const ev of events) {
|
||||
for (const p of (ev?.participants || [])) {
|
||||
register(p);
|
||||
}
|
||||
}
|
||||
|
||||
// 5. L0 atoms 的 edges.s/edges.t
|
||||
|
||||
Reference in New Issue
Block a user