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

usage for converting number to malayalam text #12

Open
dsplog opened this issue Nov 27, 2021 · 4 comments
Open

usage for converting number to malayalam text #12

dsplog opened this issue Nov 27, 2021 · 4 comments

Comments

@dsplog
Copy link

dsplog commented Nov 27, 2021

can you please advise on usage of python wrapper of mlmorph analyzer for converting number to malayalam text.

tried

from mlmorph import Analyser
analyser = Analyser()
analyser.analyse("100")

but that does not seem to be the way

@santhoshtr
Copy link
Member

There are a few more stepes involved in it. We need to use generate with input like രണ്ട്<ones><thousands>മൂന്ന്<hundreds>നാല്<tens>അഞ്ച്<ones><cardinal>. Converting a number to this format is quite easy. Please see the code - https://github.com/smc/mlmorph/blob/master/docs/components/Number.vue#L41

Then use that with generare API or python generate method.
Web API example:
https://morph.smc.org.in/api/generate?word=രണ്ട്<ones><thousands>മൂന്ന്<hundreds>നാല്<tens>അഞ്ച്<ones><cardinal>

@dsplog
Copy link
Author

dsplog commented Nov 27, 2021

thanks much.

it was straight forward to convert the code to python. created a pull request : adding python function for number spell out

ps. it does not meet the contributions guidelines, anyhow sharing here so that you can decide.

@dsplog
Copy link
Author

dsplog commented Nov 28, 2021

btw, in line

result = result.replace("ഒന്ന്<ones><hundredsa>", "<hundreds>");

"hundredsa" a typo?

@santhoshtr
Copy link
Member

btw, in line

result = result.replace("ഒന്ന്<ones><hundredsa>", "<hundreds>");

"hundredsa" a typo?

Fixed as part of f61d79e

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