Commit aa078d0
authored
fix: only use digit-by-digit reading for 4-digit years (#349)
* feat: support nbest output in normalize/tag (#296)
normalize(input, nbest=1) returns a single string (default, backward
compatible). normalize(input, nbest=N) returns a list of N-best results.
Example:
n.normalize('海淀区108号', nbest=3)
# ['海淀区一百零八号', '海淀区十八号', '海淀区幺零八号']
* fix: only use digit-by-digit reading for 4-digit years (#302)
Previously 2-digit numbers followed by 年/年度/赛季 were read
digit-by-digit (38年 => 三八年). Now only 4-digit years use this
pattern, so 38年 => 三十八年 (via number) while 2024年 => 二零二四年.1 parent 8cc6aee commit aa078d0
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
0 commit comments