diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-07-07 00:50:25 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-07-07 00:50:25 +0200 |
commit | 92bc1ed78859984486336d95641ddbdca8d02841 (patch) | |
tree | a2c0659815cbf7b5d7f9cc6ab9329ac5ed72461b /language/parser.ts | |
parent | cd01df3747ff361fab819fd1d30fac1dba6240e1 (diff) |
small updates
Diffstat (limited to 'language/parser.ts')
-rw-r--r-- | language/parser.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/language/parser.ts b/language/parser.ts index 6398595..7fd3981 100644 --- a/language/parser.ts +++ b/language/parser.ts @@ -30,7 +30,7 @@ export default class Parser { depth: optional?.depth ?? ParseDepth.Term, priorityMod: { high: optional?.priorityMod?.high ?? 10, - low: optional?.priorityMod?.low ?? 0.1, + low: optional?.priorityMod?.low ?? -10, }, breaks: optional?.breaks ?? [], } @@ -95,12 +95,12 @@ export default class Parser { // give higher priority to suffixes when last token was a name, else lower priority if (result.tags.includes(Tag.Class.Suffix)) - result.sort *= lastTokenName ? options.priorityMod.high : options.priorityMod.low; + result.sort += lastTokenName ? options.priorityMod.high : options.priorityMod.low; // give lower priority to terms matched only by their readings, and are // usually written in kanji if (!result.tags.includes(Tag.Auxiliary.UsuallyKana) && !result.match.kanji) - result.sort *= options.priorityMod.low; + result.sort += options.priorityMod.low; return result; }); |