Skip to content

Commit

Permalink
demo演示拼音转换可选保留无拼音的原字符
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed Sep 7, 2016
1 parent 727166e commit d62ce2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/test/java/com/hankcs/demo/DemoPinyin.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,9 @@ public static void main(String[] args)
System.out.printf("%s,", pinyin.getHead());
}
System.out.println();

// 拼音转换可选保留无拼音的原字符
System.out.println(HanLP.convertToPinyinString("截至2012年,", " ", true));
System.out.println(HanLP.convertToPinyinString("截至2012年,", " ", false));
}
}

0 comments on commit d62ce2b

Please sign in to comment.