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

when set preserve_punctuation=True , it produce exceeded error. #123

Closed
sunnnnnnnny opened this issue May 5, 2022 · 1 comment
Closed

Comments

@sunnnnnnnny
Copy link

sunnnnnnnny commented May 5, 2022

Describe the bug

import phonemizer as ph
from phonemizer.separator import Separator
 phonemized = ph.phonemize(lines, language_switch='remove-flags', separator=Separator(phone='-', word=' '),preserve_punctuation=True)
File "/data/home/*/.conda/envs/*/lib/python3.8/site-packages/phonemizer/punctuation.py", line 187, in _restore_aux
   return cls._restore_current(current, text, marks, num)
 File "/data/home/*/.conda/envs/*/lib/python3.8/site-packages/phonemizer/punctuation.py", line 151, in _restore_current
   @classmethod
 File "/data/home/*/.conda/envs/*/lib/python3.8/bdb.py", line 90, in trace_dispatch
   return self.dispatch_call(frame, arg)
 File "/data/home/*.conda/envs/*/lib/python3.8/bdb.py", line 128, in dispatch_call
   if not (self.stop_here(frame) or self.break_anywhere(frame)):
 File "/data/home/*/.conda/envs/*/lib/python3.8/site-packages/IPython/core/debugger.py", line 808, in break_anywhere
   sup = super().break_anywhere(frame)
 File "/data/home/*/.conda/envs/*/lib/python3.8/bdb.py", line 252, in break_anywhere
   return self.canonic(frame.f_code.co_filename) in self.breaks
 File "/data/home/*/.conda/envs/*/lib/python3.8/bdb.py", line 45, in canonic
   if filename == "<" + filename[1:-1] + ">":
RecursionError: maximum recursion depth exceeded in comparison

Phonemizer version
3.1.1

System
linux

Expected behavior
len(lines) >= 2000
when i don't set preserve_punctuation=True, it works; when i set preserve_punctuation=True,if produce exceeded error;

@jncasey
Copy link
Collaborator

jncasey commented May 5, 2022

Hi @sunnnnnnnny. The latest master has fixed the punctuation recursion error. I'm not sure when the next release is coming, but for now the current master should solve your problem.

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

2 participants