getEndsClass method
Implementation
List<String> getEndsClass(String word) {
List<String> newWords = [];
//0:Unknown 1:ne 2:me 3:le 4:ye 5:re 6:wa 7:o-3,u-3
int iRet = 0;
if (word == oArr[0]) {
// ᡥᡭ
//o
newWords.add(eArr[3] + uArr[9]); // ᡥᡳ
newWords.add(oArr[9]); // ᡳ
newWords.add(oArr[6]); // ᡭ
} else if (word == eArr[3] + uArr[11]) {
// ᡥᡭᡦ
//u
newWords.add(eArr[3] + uArr[9]); // ᡥᡳ
newWords.add(uArr[3]); // ᡥᡭᡬ
} else if (word.length > 2) {
//wchar_t cLast = word.c_str()[word.length - 1];
// wchar_t cPreLast = word.c_str()[word.length - 2];
String scLast = word.substring(word.length - 1, word.length);
String sPreLast = word.substring(word.length - 2, word.length - 1);
String subWordPre = word.substring(0, word.length - 2);
if (scLast == aArr[11]) {
if (sPreLast == nArr[10]) {
//na
subWordPre += nArr[7] + aArr[9];
iRet = 1;
} else if (sPreLast == mArr[9]) {
//ma
subWordPre += mArr[6] + aArr[9];
iRet = 2;
} else if (sPreLast == lArr[9]) {
//la
subWordPre += lArr[6] + aArr[9];
iRet = 3;
} else if (sPreLast == yArr[9]) {
//ya
subWordPre += yArr[6] + aArr[9];
iRet = 4;
} else if (sPreLast == rArr[9]) {
//ra
subWordPre += rArr[6] + aArr[9];
iRet = 5;
}
} else if (sPreLast == wArr[6] && scLast == aArr[9]) {
//wa
subWordPre += oArr[9] + aArr[11];
iRet = 6;
}
if (iRet != 0) {
newWords.add(subWordPre);
}
}
return newWords;
}