aboutsummaryrefslogtreecommitdiff
path: root/language
diff options
context:
space:
mode:
Diffstat (limited to 'language')
-rw-r--r--language/parser.ts6
-rw-r--r--language/readme.md4
-rw-r--r--language/tags.ts23
3 files changed, 19 insertions, 14 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;
});
diff --git a/language/readme.md b/language/readme.md
index c889c9d..99a7d69 100644
--- a/language/readme.md
+++ b/language/readme.md
@@ -30,7 +30,7 @@ Some tag classes impact the parser's behavior. For example, the input text
to deconjugate a noun with the verb 「する」 back into the stem.
Other uses of this behavior include more accurate automatic kanji reading
-generation, for example 「城」 b:ing read as 「じょう」 in 「ハイラル城」
+generation, for example 「城」 being read as 「じょう」 in 「ハイラル城」
because 「ハイラル」 has the tag `name:place` in the database, and
「城(じょう)」 has `class:suffix`, while 「城(しろ)」 has `class:noun`.
@@ -44,7 +44,7 @@ instead of 「トト湖(こ)」 as an expression to fix the reading of the kanji
If Yomikun doesn't generate the correct reading, and the reading isn't based on
natural language context (=a computer *could* accurately decide which reading
is correct based on other words/tags in the sentence), please submit a pull
-request with the sentence and it's (expected) reading. An example of a
+request with the sentence and its (expected) reading. An example of a
non-deterministic reading is 「何」 in the sentence 「何できた?」 which can be
read as both 「なん」 in which case 「何で」 turns into a single word, or
「なに」 where 「何」 is a regular word and 「で」 is particle.
diff --git a/language/tags.ts b/language/tags.ts
index 4205e72..7f5757f 100644
--- a/language/tags.ts
+++ b/language/tags.ts
@@ -6,18 +6,21 @@ export const Tag = {
Class: {
/** @constant verb subgroup */
Verb: {
- /** @constant noun that can be conjugated into a verb by adding する */
+ /** @constant noun that can be conjugated into a verb by adding する and する itself */
Suru: "class:verb:suru",
/**
- * @constant verb stored as conjugated noun in database
+ * @constant verb stored as conjugated noun in database (nominal verb)
*
- * some dictionaries do this, also used internally to represent
- * conjugation if found for suru-verb
+ * @deprecated The use of conjugated forms in dictionaries is discouraged.
+ *
+ * This tag is added by the deconjugation code to check for a legal
+ * deconjugation if する has been deconjugated away for a word marked
+ * suru-verb.
*/
SuruIncluded: "class:verb:suru-included",
- /** @constant godan verbs (〜う in [taekim]) */
+ /** @constant 〜う verbs in [taekim] (godan) */
U: "class:verb:u",
- /** @constant ichidan verbs (〜る in [taekim]) */
+ /** @constant 〜る verbs in [taekim] (ichidan) */
Ru: "class:verb:ru",
/** @constant kuru (来る) */
Kuru: "class:verb:kuru",
@@ -101,12 +104,14 @@ export const Tag = {
Na: "infl:reason:adj:na",
},
},
- /** @constant passive form (e.g. 言われる) */
+ /** @constant makes a verb usable without specifying who carries it out (e.g. 言われる) */
Passive: "infl:passive",
/** @constant indicates that a verb *can* happen (e.g. 落ちられる) */
Potential: "infl:potential",
- Causative: "infl:causative", // TODO: jsdoc this
- Imperative: "infl:imperative",
+ /** @constant indicates that someone makes a verb happen (e.g. ⾷べさせる) */
+ Causative: "infl:causative",
+ /** @constant imperative form (e.g. 聞け) */
+ Command: "infl:command",
},
/** @constant uncategorized tags */
Auxiliary: {