mlmorph icon indicating copy to clipboard operation
mlmorph copied to clipboard

usage for converting number to malayalam text

Open dsplog opened this issue 4 years ago • 4 comments

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

dsplog avatar Nov 27 '21 03:11 dsplog

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>

santhoshtr avatar Nov 27 '21 04:11 santhoshtr

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 avatar Nov 27 '21 05:11 dsplog

btw, in line https://github.com/smc/mlmorph/blob/4641a5814a90b4e7b0dbea011f535218dd17f068/docs/components/Number.vue#L36

"hundredsa" a typo?

dsplog avatar Nov 28 '21 02:11 dsplog

btw, in line

https://github.com/smc/mlmorph/blob/4641a5814a90b4e7b0dbea011f535218dd17f068/docs/components/Number.vue#L36

"hundredsa" a typo?

Fixed as part of f61d79e

santhoshtr avatar Dec 17 '21 05:12 santhoshtr