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

IndexError: list index out of range #152

Open
explrA opened this issue May 4, 2023 · 2 comments
Open

IndexError: list index out of range #152

explrA opened this issue May 4, 2023 · 2 comments

Comments

@explrA
Copy link

explrA commented May 4, 2023

I am trying to use Epitran for English language and I am getting IndexError when trying to run the following code:
(It works fine for other langauges apart from English)

import epitran
import regex
epi = epitran.Epitran('eng-Latn')
print(epi.transliterate(u'Berkeley'))

Gives me the following error

WARNING:epitran:lex_lookup (from flite) is not installed.
Traceback (most recent call last):
  File "/epi_test.py", line 4, in <module>
    print(epi.transliterate(u'Berkeley'))
  File "/home/epienv/lib/python3.10/site-packages/epitran/_epitran.py", line 52, in transliterate
    return self.epi.transliterate(word, normpunc, ligatures)
  File "/home/epienv/lib/python3.10/site-packages/epitran/flite.py", line 96, in transliterate
    acc.append(self.english_g2p(chunk))
  File "/home/epienv/lib/python3.10/site-packages/epitran/flite.py", line 214, in english_g2p
    arpa_text = arpa_text.splitlines()[0]
IndexError: list index out of range

Versions being used:
Python - 3.10.1
Epitran - 1.24

Can someone please help me resolve this issue.

TIA,
explr

@caixxiong
Copy link

The same question to me

@dmort27
Copy link
Owner

dmort27 commented Jan 10, 2024

Did you install the lex_lookup binary from flite, as described in the README?

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

3 participants