dmort27 / epitran

A tool for transcribing orthographic text as IPA (International Phonetic Alphabet)
MIT License
625 stars 120 forks source link

Can not reproduce the example #160

Open JohnHerry opened 10 months ago

JohnHerry commented 10 months ago

Thanks for the job.

I have download the mandarin cedict file and tried the example code

`from epitran.backoff import Backoff

backoff = Backoff(['hin-Deva', 'eng-Latn', 'cmn-Hans'], cedict_file=‘cedict_1_0_ts_utf-8_mdbg.txt') backoff.transliterate('हिन्दी') 'ɦindiː' backoff.transliterate('English') 'ɪŋɡlɪʃ' backoff.transliterate('中文') 'ʈ͡ʂoŋwən'`

But when I use backoff to transliterate an English word, It raise Exception:

""" arpa_text = arpa_text.splitlines()[0] Index out of range """

When I input Chinese, it can convert output of the form PinYin but not IPA.

How to make IPA output when my input is a sentence of bilingural-English-Chinese characters?