Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

分数如何转换? #13

Open
gbbin opened this issue Sep 30, 2021 · 2 comments
Open

分数如何转换? #13

gbbin opened this issue Sep 30, 2021 · 2 comments

Comments

@gbbin
Copy link

gbbin commented Sep 30, 2021

“三分之二”转到“3/2”很容易做到,但是如何做到“三分之二”转到“2/3”? @xingchensong @dophist

@xingchensong
Copy link
Contributor

we convert fractions with two-stage method:

  • stage-1 : tag and construct fraction structure
    • "三分之二" ==> “fraction { denominator: "3" frac: "/" numerator: "2" }”
  • stage-2 : reorder and deconstruct
    • “fraction { denominator: "3" frac: "/" numerator: "2" }” ==> “fraction { numerator: "2" frac: "/" denominator: "3" }” ==> "2/3"

We have impl this functionality for Chinese ITN in wenet-text-processing, feel free to have a try.

Note that wenet-text-processing is still in progress and it only support CN ITN currently. We plan to add rules for EN ITN/ EN TN/ CN TN, if u are interested in building those rules, any PR is welcomed.

@gbbin
Copy link
Author

gbbin commented Nov 18, 2021

感谢帮助,把你的代码也看完了,收获很大。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants