Closed hasandiwan closed 3 years ago
This works for me. The only way I can see to get this to happen is if someone forget to import lemminflect
lemminflect.__init__.py has code to set the hooks into spaCy which is called when you import.
>>> import spacy
>>> import lemminflect
>>> spacy.load("en_core_web_sm")('test this')[0]._.inflect("NNS")
'tests'
This above works. If this doesn't for you, please give me the version of spaCy, os, etc.. and exactly the commands you're running.
gives me "Can't retrieve unregistered extension attribute 'inflect'. Did you forget to call the
set_extension
method?".If I follow the message and add "spacy.tokens.Token.set_extension('inflect', method=Inflections().spacyGetInfl)", I now get " Extension 'inflect' already exists on Token. To overwrite the existing extension, set
force=True
onToken.set_extension
"If I add force=True, it gives me what I want, but there's no mention of this in the tests.
If you'd like, I can add a test to this extent or a note in the README.