diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/deinflection/test.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/deinflection/test.ts b/test/deinflection/test.ts index 6c1667b..291ed83 100644 --- a/test/deinflection/test.ts +++ b/test/deinflection/test.ts @@ -10,9 +10,10 @@ cases.forEach(({ input, mustHave, mustNotHave, force }) => { throw new Error("No parsed terms for input"); // console.log(terms); - var result = terms.find(t => t.source == input); + terms = terms.filter(t => t.source == input); if (force) - result = terms.find(t => t.reading == force.reading && t.writing == force.writing); + terms = terms.filter(t => t.reading == force.reading && t.writing == force.writing); + var result = terms[0]; if (!result) throw new Error("No deconjugation found for input"); @@ -26,7 +27,7 @@ cases.forEach(({ input, mustHave, mustNotHave, force }) => { if (result.tags.includes(tag)) throw new Error(`Deconjugation includes unallowed tag ${tag}`); - console.log(result.writing + " + " + result.tags.filter(tag => tag.startsWith("infl:") && !tag.startsWith("infl:reason:")).join(" + ")); + // console.log(result.writing + " + " + result.tags.filter(tag => tag.startsWith("infl:") && !tag.startsWith("infl:reason:")).join(" + ")); }); }) |