mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-30 11:45:04 +00:00
feat(memory): add Japanese query expansion support for FTS (#23156)
* Memory: add Japanese query expansion support * Docs/Changelog: credit Japanese FTS update
This commit is contained in:
@@ -95,6 +95,28 @@ describe("extractKeywords", () => {
|
||||
expect(keywords).toContain("논의");
|
||||
});
|
||||
|
||||
it("extracts keywords from Japanese conversational query", () => {
|
||||
const keywords = extractKeywords("昨日話したデプロイ戦略");
|
||||
expect(keywords).toContain("デプロイ");
|
||||
expect(keywords).toContain("戦略");
|
||||
expect(keywords).not.toContain("昨日");
|
||||
});
|
||||
|
||||
it("handles mixed Japanese and English query", () => {
|
||||
const keywords = extractKeywords("昨日話したAPIのバグ");
|
||||
expect(keywords).toContain("api");
|
||||
expect(keywords).toContain("バグ");
|
||||
expect(keywords).not.toContain("した");
|
||||
});
|
||||
|
||||
it("filters Japanese stop words", () => {
|
||||
const keywords = extractKeywords("これ それ そして どう");
|
||||
expect(keywords).not.toContain("これ");
|
||||
expect(keywords).not.toContain("それ");
|
||||
expect(keywords).not.toContain("そして");
|
||||
expect(keywords).not.toContain("どう");
|
||||
});
|
||||
|
||||
it("handles empty query", () => {
|
||||
expect(extractKeywords("")).toEqual([]);
|
||||
expect(extractKeywords(" ")).toEqual([]);
|
||||
|
||||
Reference in New Issue
Block a user