fix(hldp): rank Chinese causal branch queries
This commit is contained in:
parent
a483b2a1b9
commit
fb1096c5ec
2 changed files with 18 additions and 1 deletions
|
|
@ -48,6 +48,12 @@ test("route returns paths and summaries only, capped at three", () => {
|
|||
assert(!JSON.stringify(candidates).includes("A失败"));
|
||||
});
|
||||
|
||||
test("route ranks a matching Chinese branch instead of treating a sentence as one token", () => {
|
||||
const candidates = route(validTree(), "为什么最终方案发生变化", 3);
|
||||
assert.equal(candidates[0].path, "root/decision");
|
||||
assert(candidates[0].score > 0);
|
||||
});
|
||||
|
||||
test("read-node reads exactly one bounded node", () => {
|
||||
const node = readNode(validTree(), "root/decision");
|
||||
assert.equal(node.path, "root/decision");
|
||||
|
|
|
|||
Loading…
Reference in a new issue