Filtered out other languages from kanji dic2

This commit is contained in:
Willem Cazander 2025-01-24 11:46:56 +01:00
parent 77e27954f1
commit dd044a93ab

View file

@ -69,6 +69,7 @@ public class KanjiDict {
KanjiDictLiteral literal; KanjiDictLiteral literal;
String cpType; String cpType;
String qcType; String qcType;
String mLang;
private void addLiteral() { private void addLiteral() {
if (literal.kuTen208 != null) { if (literal.kuTen208 != null) {
@ -109,7 +110,10 @@ public class KanjiDict {
literal.fourCorner = Integer.parseInt(bufChar.toString().replaceAll("\\.", "")); literal.fourCorner = Integer.parseInt(bufChar.toString().replaceAll("\\.", ""));
} }
} else if ("meaning".equals(qName)) { } else if ("meaning".equals(qName)) {
literal.meaning.add(bufChar.toString()); if (mLang == null) {
literal.meaning.add(bufChar.toString());
}
mLang = null;
} }
bufChar = new StringBuilder(); bufChar = new StringBuilder();
} }
@ -146,6 +150,8 @@ public class KanjiDict {
cpType = atts.getValue("cp_type"); cpType = atts.getValue("cp_type");
} else if ("q_code".equals(qName)) { } else if ("q_code".equals(qName)) {
qcType = atts.getValue("qc_type"); qcType = atts.getValue("qc_type");
} else if ("meaning".equals(qName)) {
mLang = atts.getValue("m_lang");
} }
} }