Bugs in BaseDialect.py
thangld201 opened this issue · 1 comments
thangld201 commented
- I think there's a typo in Line 2003 in BaseDialect.py
def not_preverbal_negator(self):
# feature 161
self.preverbal_negator(replace="not", name="no_preverbal_negator") # <- should be name="not_preverbal_negator"
I see that some dialects do not have no_preverbal_negator
in the transformation rules, so when this feature is triggered it will raise key error.
- Line 336-338: In
is_capitalized(self, string)
, if the original string has space in the left e.g.string = ' abc'
or starts with numbers, etc...
thenself.is_capitalized(string)
will returnTrue
--> I think it should be better changed tostring.strip()[0].isupper()
?
def is_capitalized(self, string):
"""returns boolean value indicating whether @string is capitalized"""
return self.capitalize(string) == string
Helw150 commented
Fixed the first!
For the second, we're calling is_capitalized on tokens fed from spacy which are already stripped.