-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Labels
Status: PR WelcomeWelcome to Pull RequestWelcome to Pull RequestType: BugBug or Bug fixesBug or Bug fixes
Description
matchToReplace(text, /数([0-9]+)倍/g, toKanNumber);
matchToReplace(text, /数([0-9]+)[兆億万]/g, toKanNumber);
matchToReplace(text, /数([0-9]+)年/g, toKanNumber);
このルールはおそらく数10倍
などを数十倍
に訂正するためのものだと思います。
ですが、周波数2倍ごと〜
といった文脈の場合にもエラーが出てしまいます。
また、漢数字を使う数n倍
というような言い回しは、n
が10の倍数
の時しか起きないと思います。
例えば、数十倍
・数百倍
といった言い回しはありますが、数二倍
というような言い回しはまず見ません。
したがって、以下のような修正が適当だと考えられますがいかがでしょうか。
matchToReplace(text, /数(10*)倍/g, toKanNumber);
matchToReplace(text, /数(10*)[兆億万]/g, toKanNumber);
matchToReplace(text, /数(10*)年/g, toKanNumber);
Metadata
Metadata
Assignees
Labels
Status: PR WelcomeWelcome to Pull RequestWelcome to Pull RequestType: BugBug or Bug fixesBug or Bug fixes