Skip to content

Commit

Permalink
Address code review comments
Browse files Browse the repository at this point in the history
Also removes a section of code that is now redundant, since the
`phrases` dictionary is now pre-populated with all entries in
`bpmf_chars`.
  • Loading branch information
lukhnos committed Feb 3, 2025
1 parent d776acb commit 1de1c3b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Source/Data/bin/cook.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
sys.exit('[ERROR] %s key mismatches.' % mykey)
phrases[mykey] = myvalue

for (mykey, myvalue) in phrases.items():
for mykey, myvalue in phrases.items():
readings = bpmf_phrases.get(mykey)

if readings:
Expand Down Expand Up @@ -191,11 +191,6 @@
# 很罕用的注音建議不要列入 heterophony?.list,這樣的話
# 就可以直接進來這個 condition
handle.close()
for k in bpmf_chars:
if k not in phrases:
for v in bpmf_chars[k]:
output.append((k, v, UNK_LOG_FREQ))
pass

with open(sys.argv[4]) as punctuations_file:
for line in punctuations_file:
Expand Down

0 comments on commit 1de1c3b

Please sign in to comment.