Skip to content

Commit

Permalink
Remove redundant validation logic
Browse files Browse the repository at this point in the history
`bpmf_phrases` is guaranteed to have entries from `bpmf_chars`, and so
we only need to validate data when reading from `PhraseFreq.txt`.
  • Loading branch information
lukhnos committed Feb 2, 2025
1 parent 7b710fc commit d776acb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Source/Data/bin/cook.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,8 @@
phrases[mykey] = myvalue

for (mykey, myvalue) in phrases.items():
try:
readings = bpmf_phrases[mykey]
except:
sys.exit('[ERROR] %s key mismatches.' % mykey)
readings = bpmf_phrases.get(mykey)

# print mykey
if readings:
# 剛好一個中文字字的長度目前還是 3 (標點、聲調好像都是2)
if len(mykey) > 3:
Expand Down

0 comments on commit d776acb

Please sign in to comment.