tresoldi / distfeat

A Python library for manipulating segmental/distinctive phonological features
MIT License
5 stars 1 forks source link

Bug: self._bipa is not always initialized #3

Open XachaB opened 4 years ago

XachaB commented 4 years ago

Currently, self.bipa is not always initialized in the DistFeat class. The lines below only initialize self.bipa when the path was not given by the user:

https://github.com/tresoldi/distfeat/blob/ba8157de412100f60ef430b6b939c32ce8c53e69/distfeat/distfeat.py#L117-L123

Something such as the following is missing:

    else:
        self._bipa = pyclts.CLTS(clts).bipa

This currently causes a bug when checking:

https://github.com/tresoldi/distfeat/blob/ba8157de412100f60ef430b6b939c32ce8c53e69/distfeat/distfeat.py#L206

Moreover, since self._bipa is never False, but instead None, the check should be if self._bipa is not None:.