aboutsummaryrefslogtreecommitdiff
path: root/test/deinflection/test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/deinflection/test.ts')
-rw-r--r--test/deinflection/test.ts17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/deinflection/test.ts b/test/deinflection/test.ts
index 017a5c7..1d2f172 100644
--- a/test/deinflection/test.ts
+++ b/test/deinflection/test.ts
@@ -1,17 +1,18 @@
import cases from "./cases.ts";
import { core } from '../base.ts';
-import { TokenTag } from '../../language/tags.ts';
+import { TokenTag } from "../../search/tags.ts";
-cases.forEach(({ input, mustHave, mustNotHave, forceID }) => {
+cases.forEach(({ input, mustHave, mustNotHave, force }) => {
Deno.test(`deinflection - ${input}`, async () => {
- var { tokens } = await core.parseSentence(input);
+ var terms = await core.search.terms(input);
- if (tokens.length == 0)
- throw new Error("No parsed tokens for input");
+ if (terms.length == 0)
+ throw new Error("No parsed terms for input");
- // console.log(tokens);
- var result = tokens.find(t => t.source == input);
- if (forceID) result = tokens.find(t => t.term_id == forceID);
+ // console.log(terms);
+ var result = terms.find(t => t.source == input);
+ if (force)
+ result = terms.find(t => t.reading == force.reading && t.writing == force.writing);
if (!result)
throw new Error("No deconjugation found for input");