Skip to content

Commit

Permalink
[tn] fix Japanese TN
Browse files Browse the repository at this point in the history
  • Loading branch information
LoganLiu66 committed Oct 29, 2024
1 parent db99bdd commit 72022ce
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tn/japanese/rules/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ def build_tagger(self):
noon = string_file(get_abs_path('japanese/data/time/noon.tsv'))

colon = delete(':') | delete(':')
h_noon = (insert('hour: "') + h + insert('" noon: "') + noon +
insert('"'))
h = insert('hour: "') + h + insert('" ')
m = insert('minute: "') + m + insert('"')
s = insert(' second: "') + s + insert('"')
noon = insert(' noon: "') + noon + insert('"')

tagger = (
(h + colon + m + (colon + s).ques + delete(' ').ques + noon.ques)
|
(insert('hour: "') + h + insert('" noon: "') + noon + insert('"')))
tagger = ((h + colon + m +
(colon + s).ques + delete(' ').ques + noon.ques)
| h_noon)
tagger = self.add_tokens(tagger)

to = (delete('-') | delete('~')) + insert(' char { value: "から" } ')
Expand Down

0 comments on commit 72022ce

Please sign in to comment.