Closed GabrielLin closed 3 years ago
@GabrielLin Can you provide the python traceback as well?
@nipunsadvilkar , here it is.
>>> seg = pysbd.Segmenter(language="en", clean=False)
>>> print(seg.segment(a))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/XXXX/.conda/envs/py36dmc/lib/python3.6/site-packages/pysbd/segmenter.py", line 87, in segment
postprocessed_sents = self.processor(text).process()
File "/home/XXXX/.conda/envs/py36dmc/lib/python3.6/site-packages/pysbd/processor.py", line 34, in process
self.replace_abbreviations()
File "/home/XXXX/.conda/envs/py36dmc/lib/python3.6/site-packages/pysbd/processor.py", line 180, in replace_abbreviations
self.text = self.abbreviations_replacer().replace()
File "/home/XXXX/.conda/envs/py36dmc/lib/python3.6/site-packages/pysbd/abbreviation_replacer.py", line 37, in replace
abbr_handled_text += self.search_for_abbreviations_in_string(line)
File "/home/XXXX/.conda/envs/py36dmc/lib/python3.6/site-packages/pysbd/abbreviation_replacer.py", line 93, in search_for_abbreviations_in_string
text, match, ind, char_array
File "/home/XXXX/.conda/envs/py36dmc/lib/python3.6/site-packages/pysbd/abbreviation_replacer.py", line 111, in scan_for_replacements
txt = self.replace_period_of_abbr(txt, am)
File "/home/XXXX/.conda/envs/py36dmc/lib/python3.6/site-packages/pysbd/abbreviation_replacer.py", line 71, in replace_period_of_abbr
txt,
File "/home/XXXX/.conda/envs/py36dmc/lib/python3.6/re.py", line 191, in sub
return _compile(pattern, flags).sub(repl, string, count)
File "/home/XXXX/.conda/envs/py36dmc/lib/python3.6/re.py", line 301, in _compile
p = sre_compile.compile(pattern, flags)
File "/home/XXXX/.conda/envs/py36dmc/lib/python3.6/sre_compile.py", line 562, in compile
p = sre_parse.parse(p, flags)
File "/home/XXXX/.conda/envs/py36dmc/lib/python3.6/sre_parse.py", line 855, in parse
p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
File "/home/XXXX/.conda/envs/py36dmc/lib/python3.6/sre_parse.py", line 416, in _parse_sub
not nested and not items))
File "/home/XXXX/.conda/envs/py36dmc/lib/python3.6/sre_parse.py", line 702, in _parse
source.tell() - start)
sre_constants.error: missing ), unterminated subpattern at position 0
Please help to fix it. Thanks.