diff --git a/mdict4j_usage.java b/mdict4j_usage.java new file mode 100644 index 0000000..27eb72f --- /dev/null +++ b/mdict4j_usage.java @@ -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(); + } \ No newline at end of file