-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f54ec1
commit d0cda92
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# coding: utf-8 | ||
|
||
from __future__ import (print_function, unicode_literals) | ||
|
||
from ChineseTone import * | ||
|
||
print(','.join(PinyinHelper.convertToPinyinFromSentence('金馆长啊', pinyinFormat=PinyinFormat.WITHOUT_TONE))) | ||
PinyinHelper.addWordPinyin('金馆长', ['jin', 'guan', 'zhang']) # 建议实际情况下拼音中加入声调 | ||
print(','.join(PinyinHelper.convertToPinyinFromSentence('金馆长啊', pinyinFormat=PinyinFormat.WITHOUT_TONE))) | ||
|
||
print(','.join(PinyinHelper.convertToPinyinFromSentence('价值40$', pinyinFormat=PinyinFormat.WITHOUT_TONE))) | ||
PinyinHelper.addCharPinyin('4', ['si']) # 考虑多音字,所以用list | ||
PinyinHelper.addCharPinyin('0', ['ling']) | ||
PinyinHelper.addWordPinyin('$', ['mei', 'yuan']) # 这个用法奇怪些 | ||
print(','.join(PinyinHelper.convertToPinyinFromSentence('价值40$', pinyinFormat=PinyinFormat.WITHOUT_TONE))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters