diff --git a/3-tidy-up.js b/3-tidy-up.js index 3f99f71..61fa023 100644 --- a/3-tidy-up.js +++ b/3-tidy-up.js @@ -23,7 +23,7 @@ function isInflectionGloss(glosses, formOf) { glossesString = JSON.stringify(glosses); switch (targetIso) { case 'de': - if (glosses.some(gloss => /des (?:Verbs|Adjektivs|Substantivs)/.test(gloss))) return true; + if (glosses.some(gloss => /des (?:Verbs|Adjektivs|Substantivs|Demonstrativpronomens|Possessivpronomens|Pronomens)/.test(gloss))) return true; case 'en': if (glosses.some(gloss => /.*inflection of.*/.test(gloss))) return true; if(!Array.isArray(formOf)) return false; @@ -296,7 +296,7 @@ function processInflectionGlosses(glosses, word, pos) { } function processGermanInflectionGlosses(glosses, word, pos) { - const match1 = glosses[0].match(/(.*)des (?:Verbs|Adjektivs|Substantivs) (.*)$/); + const match1 = glosses[0].match(/(.*)des (?:Verbs|Adjektivs|Substantivs|Demonstrativpronomens|Possessivpronomens|Pronomens) (.*)$/); if (!match1 || match1.length < 3) return; const inflection = match1[1].trim(); const lemma = match1[2].trim(); diff --git a/4-make-yomitan.js b/4-make-yomitan.js index 0ae32a6..46f7b08 100644 --- a/4-make-yomitan.js +++ b/4-make-yomitan.js @@ -316,9 +316,16 @@ let lastTermBankIndex = 0; hypotheses = hypotheses .map((hypothesis) => hypothesis - .map((inflection) => (inflection).trim()) + .map((inflection) => inflection.trim()) .filter(Boolean) - ).filter(hypothesis => hypothesis.length); + ) + .filter(hypothesis => hypothesis.length) + .map((hypothesis) => + hypothesis.map((inflection) => + inflection.replace(/\u00A0/g, ' ') + ) + ); + return hypotheses; }); diff --git a/data/test/dict/cs/en/term_bank_2.json b/data/test/dict/cs/en/term_bank_2.json index b66b024..210d3d7 100644 --- a/data/test/dict/cs/en/term_bank_2.json +++ b/data/test/dict/cs/en/term_bank_2.json @@ -11,7 +11,7 @@ [ "singular", "feminine", - "past active participle" + "past active participle" ] ], [ @@ -19,7 +19,7 @@ [ "plural", "neuter", - "past active participle" + "past active participle" ] ] ], @@ -38,7 +38,7 @@ [ "first-person", "singular", - "present indicative" + "present indicative" ] ] ], @@ -66,7 +66,7 @@ [ "first-person", "plural", - "present indicative" + "present indicative" ] ] ], @@ -85,7 +85,7 @@ [ "second-person", "singular", - "present indicative" + "present indicative" ] ] ], @@ -113,7 +113,7 @@ [ "second-person", "plural", - "present indicative" + "present indicative" ] ] ], @@ -152,7 +152,7 @@ [ "singular", "masculine", - "present transgressive" + "present transgressive" ] ], [ @@ -160,7 +160,7 @@ [ "third-person", "singular", - "present indicative" + "present indicative" ] ] ], @@ -179,7 +179,7 @@ [ "third-person", "plural", - "present indicative" + "present indicative" ] ] ], @@ -199,7 +199,7 @@ "singular", "past", "participle", - "masculine animate" + "masculine animate" ] ], [ @@ -208,7 +208,7 @@ "singular", "past", "participle", - "masculine inanimate" + "masculine inanimate" ] ] ], @@ -228,7 +228,7 @@ "plural", "past", "participle", - "masculine animate" + "masculine animate" ] ] ], @@ -257,7 +257,7 @@ "plural", "past", "participle", - "masculine inanimate" + "masculine inanimate" ] ] ], @@ -296,7 +296,7 @@ [ "singular", "masculine", - "present transgressive" + "present transgressive" ] ] ], @@ -316,7 +316,7 @@ "singular", "feminine", "neuter", - "present transgressive" + "present transgressive" ] ] ], @@ -336,7 +336,7 @@ "singular", "feminine", "neuter", - "present transgressive" + "present transgressive" ] ] ], @@ -354,7 +354,7 @@ "přít", [ "plural", - "present transgressive" + "present transgressive" ] ] ], @@ -372,7 +372,7 @@ "přít", [ "plural", - "present transgressive" + "present transgressive" ] ] ], diff --git a/data/test/dict/de/en/term_bank_2.json b/data/test/dict/de/en/term_bank_2.json index 9e911d5..12f8405 100644 --- a/data/test/dict/de/en/term_bank_2.json +++ b/data/test/dict/de/en/term_bank_2.json @@ -89,7 +89,7 @@ [ "pflegen", [ - "past participle" + "past participle" ] ] ], @@ -149,7 +149,7 @@ [ "pflegen", [ - "past participle" + "past participle" ] ] ], @@ -193,7 +193,7 @@ [ "pflegen", [ - "present participle" + "present participle" ] ] ], diff --git a/data/test/dict/la/en/term_bank_2.json b/data/test/dict/la/en/term_bank_2.json index 525285e..02c54ef 100644 --- a/data/test/dict/la/en/term_bank_2.json +++ b/data/test/dict/la/en/term_bank_2.json @@ -2551,7 +2551,7 @@ [ "legō", [ - "perfect passive participle" + "perfect passive participle" ] ] ],