private Dictionary constructTrie(SortedSet<String> data) throws Exception {
clearWorkDir();
File sourceFile = new File(getWorkDir(), "source");
Writer w = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(sourceFile), "UTF-8"));
for (String d : data) {
w.write(d);
w.write("\n");
}
w.close();
File trieFile = new File(getWorkDir(), "dict");
return TrieDictionary.getDictionary(trieFile, Collections.<URL>singletonList(sourceFile.toURI().toURL()));
}
TrieDictionaryTest.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:incubator-netbeans
作者:
评论列表
文章目录