Skip to content

Commit

Permalink
Update jpn.morpho.mjs
Browse files Browse the repository at this point in the history
fix the bug of type mismatch of いる(v1) 居る(v1) 要る(v5) 入る(v5) 炒る(v5) and 煎る(v5)
  • Loading branch information
shilik authored Oct 16, 2023
1 parent 1090067 commit 9ea6243
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/jpn/jpn.morpho.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ tSound = "っっいしっんんんいじ",//verify ず
aSound = "わらかさたまなばがじ";//verify ず

const ruV5List = {
"い": 1, "き": 1, "け": 1, "し": 1, "じ": 1, "ね": 1, "び": 1, "上": 1, "下": 1, "与": 1, "中": 1,
"き": 1, "け": 1, "し": 1, "じ": 1, "ね": 1, "び": 1, "上": 1, "下": 1, "与": 1, "中": 1,
"乗": 1, "乘": 1, "亘": 1, "亙": 1, "交": 1, "代": 1, "伐": 1, "余": 1, "作": 1, "侍": 1, "依": 1,
"侮": 1, "便": 1, "係": 1, "倚": 1, "借": 1, "偏": 1, "偽": 1, "傲": 1, "優": 1, "光": 1, "入": 1,
"写": 1, "冠": 1, "凍": 1, "凝": 1, "凭": 1, "分": 1, "切": 1, "刈": 1, "判": 1, "到": 1, "刳": 1,
Expand Down Expand Up @@ -410,9 +410,10 @@ function __jslinguaJpnStemmer(word) {
//==========================================

function __getVerbType(verb){
if (/(.)()$/g.test(verb)) return VType.V1;
if (/()$/g.test(verb)) return VType.V1;
if (/(||)$/g.test(verb)) return VType.SK;
 if (/(.)()$/g.test(verb)) return VType.V1;
if (/(|||||)$/g.test(verb)) return VType.V1;
if (/(|)$/g.test(verb)) return VType.V1;
 if (/(||)$/g.test(verb)) return VType.SK;
let end = verb.slice(-1);
let bend = verb.slice(-2,-1);
if (end === "る") {
Expand All @@ -423,7 +424,7 @@ function __getVerbType(verb){
}

{//If it ends with these; it is Godan
let v5r = /(||||||||||||)$/g;
let v5r = /(||||||||||||||||||)$/g;
if (v5r.test(verb) || ruV5List[bend]) return VType.V5;
}

Expand Down

0 comments on commit 9ea6243

Please sign in to comment.