chdzq / ARPAbetAndIPAConvertor

Apache License 2.0
64 stars 14 forks source link

Problem with most pronunciations #2

Open roholazandie opened 2 years ago

roholazandie commented 2 years ago

Thanks for the amazing repository. I realized that your code gives error on a lot of cases when I want to convert from IPA to ARPAbet. For example this one from dictionary abuse:

from arpabetandipaconvertor.phoneticarphabet2arpabet import PhoneticAlphabet2ARPAbetConvertor
ipa_convertor = PhoneticAlphabet2ARPAbetConvertor()
x = ipa_convertor.convert("əˈbyo͞oz")
print(x)

throws this exception:

Traceback (most recent call last):
  File "/home/rohola/codes/speechify-nlp/homographs/convert_ipa_arpanet.py", line 7, in <module>
    x = ipa_convertor.convert("əˈbyo͞oz")
  File "/home/rohola/codes/speechify-nlp/venv/lib/python3.10/site-packages/arpabetandipaconvertor/phoneticarphabet2arpabet.py", line 150, in convert
    raise PhonemeError('存在不能识别的音标 %s' % temp_ch)
arpabetandipaconvertor.excepts.PhonemeError: 存在不能识别的音标 yo͞oz
RobinE89 commented 1 year ago

I have the maybe the same problem. it would be great if the project is setup in english - currently its not understandable. It would be really great if that would work - because I think it would be the only converter that could be installed so easily via pip

Input -> "zˈi"

 Traceback (most recent call last):
  File "c:\Users\RIR\Documents\HSB\Masterarbeit\phonetic_analizer\ipaToArpa.py", line 30, in <module>
    main()
  File "c:\Users\RIR\Documents\HSB\Masterarbeit\phonetic_analizer\ipaToArpa.py", line 22, in main
    x = ipa_convertor.convert(ipa)
  File "C:\Users\RIR\Documents\HSB\Masterarbeit\phonetic_analizer\venv\lib\site-packages\arpabetandipaconvertor\phoneticarphabet2arpabet.py", line 114, in convert
    raise PhonemeError("%s 重音标识不合适,%s前一个音节没有元音!" % (temp_syllable_str, ch))
arpabetandipaconvertor.excepts.PhonemeError: zˈ 重音标识不合适,ˈ前一个音节没有元音!