Skip to content

Commit

Permalink
修订demo
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed Dec 8, 2017
1 parent 4240e54 commit b8a65fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/test/java/com/hankcs/demo/DemoPinyinToChinese.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public static void main(String[] args)
TreeMap<String, Set<String>> map = new TreeMap<String, Set<String>>();
for (Map.Entry<String, String> entry : dictionary.entrySet())
{
String pinyinList = entry.getValue().replaceAll("[\\d,]", "");
Set<String> words = map.get(pinyinList);
String pinyins = entry.getValue().replaceAll("[\\d,]", "");
Set<String> words = map.get(pinyins);
if (words == null)
{
words = new TreeSet<String>();
map.put(pinyinList, words);
map.put(pinyins, words);
}
words.add(entry.getKey());
}
Expand Down

0 comments on commit b8a65fe

Please sign in to comment.