projects
/
jiten-pai.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e1e2c44
)
* Correctly handle the case where a tagged field may appear more than once in a kanji...
author
Urban Wallasch
<urban.wallasch@freenet.de>
Mon, 21 Jun 2021 21:51:07 +0000
(23:51 +0200)
committer
Urban Wallasch
<urban.wallasch@freenet.de>
Mon, 21 Jun 2021 21:51:07 +0000
(23:51 +0200)
kanjidic.py
patch
|
blob
|
history
diff --git
a/kanjidic.py
b/kanjidic.py
index b49a0341a665f4c858eda572b5fbe32036b3d1ca..da7dd2cfc5bfff5e4c083b1d9f04e6ff1420ebdc 100755
(executable)
--- a/
kanjidic.py
+++ b/
kanjidic.py
@@
-205,7
+205,9
@@
def _kanjidic_load(dict_fname):
line = re_tags.sub('', line, 1)
for t in tlist:
for k in ktable:
- if t[:len(k[0])] == k[0]:
+ # if a tag appears more than once the first one wins,
+ # e.g. 'S<num>' (stroke count)
+ if t[:len(k[0])] == k[0] and not info[k[1]]:
info[k[1]] = t[len(k[0]):]
break
# get readings (i.e. all that's left)