jacksonllee / pycantonese

Cantonese Linguistics and NLP
https://pycantonese.org
MIT License
354 stars 38 forks source link

Not compatible with pylangacq version 0.13 #25

Closed Robinysh closed 3 years ago

Robinysh commented 3 years ago

Code to reproduce

import pycantonese as pc                                                                                      
pc.word_segmentation.Segmenter()   

Traceback (most recent call last):                                                                                
  File "<stdin>", line 1, in <module>                                                                             
  File "/home/lib/python3.7/site-packages/pycantonese/word_segmentation.py", line 46, in __init__
    self.fit(hkcancor().sents())                                                                                  
  File "/home/lib/python3.7/site-packages/pycantonese/corpus.py", line 334, in hkcancor
    return CantoneseCHATReader(data_path, encoding="utf8")                                                        
  File "/home/lib/python3.7/site-packages/pycantonese/corpus.py", line 31, in __init__
    super(CantoneseCHATReader, self).__init__(*filenames, encoding=encoding)
TypeError: __init__() got an unexpected keyword argument 'encoding'     

Downgrading to pylangacq==0.12.0 works as a workaround

jacksonllee commented 3 years ago

Ah, I released pylangacq 0.13.0 three days ago, and am now working on upgrading pycantonese for the breaking changes like what you've shown here. I didn't realize in pycantonese I actually had pylangacq>=0.12.0,<1.0.0 -- my bad! I've just released pycantonese 3.1.1 to pin pylangacq at exact 0.12.0 for now.

Thank you for alerting me -- I've added you in the acknowledgments!