hyphen symbol at the beginning
timbrookers opened this issue · 2 comments
Dear All
I am using pyphen in Mongolian Language.
I do have issue that the hyphen symbol is appearing at the beginning. Here is the result:
На|ран |Лув|сан ах о|лон |со|нин |хэв|лэ|нэ. |На|ран |сай|хан |ном |со|нин ав|лаа. Э|нэ |со|нин Ү|нэн |со|нин. |Хэр|лэн өөр о|лон |ном |со|нин ун|шив. |На|сан |ха|вар, |на|мар о|лон |со|нин ав|сан. Э|нэ |со|нин |хо|вор. |Ха|вар |мал өс|лөө. |Мо|лом |мал |мал|лав. |Ло|сол |ма|лаа ус|лав. |Ма|рал үх|рээ |ху|раа|лаа. Ө|вөө ү|хэр |ма|лаа |ху|раа|лаа. Э|мээ |мах |сүү а|вав. Ах |мал |мал|лав
As i am new for python, it might be that i had missed something.
Awaiting for your kind support
Hi!
Pyphen’s functions can only be used with words, not full sentences. You can for example use this code:
import pyphen
dic = pyphen.Pyphen(lang='mn_MN')
[dic.inserted(word) for word in 'Наран Лувсан ах олон сонин хэвлэнэ'.split()]
This code is not perfect, because it doesn’t take care of the punctuation marks, but that’s a good sample to understand how Pyphen works.
Hi,
Well noted. That's totally fine. important is the result that shows the syllables.
One more thing i would like to ask.
Is it possible to add some code for highlighting the syllables, for example with different colors?
Thank you in advance