SALT-NLP / multi-value

Complete set of English dialect transformation rules and evaluation code
Other
13 stars 2 forks source link

Bugs in BaseDialect.py #6

Closed thangld201 closed 3 months ago

thangld201 commented 4 months ago

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.

  2. 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
Helw150 commented 3 months ago

Fixed the first!

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