projects
/
platform
/
upstream
/
libpinyin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85a934c
)
handle tone in gen special table
author
Peng Wu
<alexepico@gmail.com>
Sun, 30 Oct 2011 08:36:44 +0000
(16:36 +0800)
committer
Peng Wu
<alexepico@gmail.com>
Sun, 30 Oct 2011 08:36:44 +0000
(16:36 +0800)
scripts/genspecialtable.py
patch
|
blob
|
history
diff --git
a/scripts/genspecialtable.py
b/scripts/genspecialtable.py
index
bb3f061
..
4315087
100644
(file)
--- a/
scripts/genspecialtable.py
+++ b/
scripts/genspecialtable.py
@@
-41,7
+41,12
@@
def load_phrase(filename):
if 0 == freq:
#print(pinyin_str)
continue
+
(first_key, second_key) = pinyin_str.split("'")
+ if first_key[-1].isdigit():
+ first_key = first_key[:-1]
+ if second_key[-1].isdigit():
+ second_key = second_key[:-1]
phrase_dict[(first_key, second_key)] = freq
phrasefile.close()
@@
-94,5
+99,7
@@
def filter_special():
if __name__ == "__main__":
load_phrase("pinyin2.txt")
+ for p in filter_divided():
+ print (p)
for p in filter_special():
print (p)