SALT-NLP/multi-value

Bugs in BaseDialect.py

thangld201 opened this issue · 1 comments

Hi @cjziems @Helw150,

  1. 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.

  1. 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...
    then self.is_capitalized(string) will return True --> I think it should be better changed to string.strip()[0].isupper() ?
    def is_capitalized(self, string):
        """returns boolean value indicating whether @string is capitalized"""
        return self.capitalize(string) == string

Fixed the first!

For the second, we're calling is_capitalized on tokens fed from spacy which are already stripped.