Add mdict4j_usage.java
This commit is contained in:
parent
1fdaec4f70
commit
c1a6a529e9
1 changed files with 14 additions and 0 deletions
14
mdict4j_usage.java
Normal file
14
mdict4j_usage.java
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// currently you need my fork:
|
||||
// https://codeberg.org/hashirama/mdict4j
|
||||
|
||||
try {
|
||||
Path dictionaryPath = Paths.get("(学研)漢字源[改訂第五版].mdx");
|
||||
MDictDictionary dictionary = MDictDictionary.loadDictionary(dictionaryPath.toString());
|
||||
System.out.println(dictionary.getTitle());
|
||||
System.out.println(dictionary.getDescription());
|
||||
for (var entry : dictionary.readArticles("来")) {
|
||||
System.out.printf("%s -> %s%n", entry.getKey(), entry.getValue());
|
||||
}
|
||||
} catch (MDException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Loading…
Reference in a new issue