pablodms / spacy-spanish-lemmatizer

Spanish rule-based lemmatization for spaCy
MIT License
37 stars 6 forks source link

TypeError: expected string or bytes-like object in wiki_parser.py, line 114 #10

Open dazulu4 opened 2 years ago

dazulu4 commented 2 years ago

When I'm trying to download wiki using this command: python3 -m spacy_spanish_lemmatizer download wiki. In parsing proccess I'm getting the a issue and I don't know how proceed:

Traceback (most recent call last):
  File "/usr/local/anaconda3/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/anaconda3/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/anaconda3/lib/python3.8/site-packages/spacy_spanish_lemmatizer/__main__.py", line 9, in <module>
    parser.process()
  File "/usr/local/anaconda3/lib/python3.8/site-packages/spacy_spanish_lemmatizer/parser/base_parser.py", line 39, in process
    self.parse()
  File "/usr/local/anaconda3/lib/python3.8/site-packages/spacy_spanish_lemmatizer/parser/wiki_parser.py", line 291, in parse
    self.__parse_source()
  File "/usr/local/anaconda3/lib/python3.8/site-packages/spacy_spanish_lemmatizer/parser/wiki_parser.py", line 224, in __parse_source
    result = self.__process_text(contenido.text, "es")
  File "/usr/local/anaconda3/lib/python3.8/site-packages/spacy_spanish_lemmatizer/parser/wiki_parser.py", line 114, in __process_text
    lengua_match = self.__lengua_regex.search(text)
TypeError: expected string or bytes-like object

I installed the next versions for spacy package: spacy==3.0.8 spacy-spanish-lemmatizer==0.6

¡Thank you!

pablodms commented 2 years ago

Hello @dazulu4 !

I have spotted and fixed the issue you mention. It should be OK now. The information you have given me has helped me a lot, thank you :)

Let me know if the error persists.

Best regards