Skip to content

Commit

Permalink
使热更新产生的缓存文件包含用户词性 fix hankcs#1028
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed Nov 24, 2018
1 parent de42c07 commit 9acb8c4
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ private static boolean loadMainDictionary(String mainPath)
}
DataOutputStream out = new DataOutputStream(IOUtil.newOutputStream(mainPath + Predefine.BIN_EXT));
// 缓存用户词性
if (customNatureCollector.isEmpty()) // 热更新
{
for (int i = Nature.begin.ordinal() + 1; i < Nature.values().length; ++i)
{
customNatureCollector.add(Nature.values()[i]);
}
}
IOUtil.writeCustomNature(out, customNatureCollector);
// 缓存正文
out.writeInt(attributeList.size());
Expand Down

0 comments on commit 9acb8c4

Please sign in to comment.