Skip to content

Commit

Permalink
Fix asserts in DanNet
Browse files Browse the repository at this point in the history
  • Loading branch information
ophelielacroix committed Jan 7, 2021
1 parent 0e7a961 commit cfe657d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions danlp/datasets/dannet.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,14 @@ def _synset_ids(self, word, pos=None):

def _word_from_id(self, word_id):

assert(type(word_id) == int or (type(word_id) == str and word_id.is_digit()))
assert(type(word_id) == int or (type(word_id) == str and word_id.isdigit()))
word_id = str(word_id)

return self.words[self.words['word_id'] == word_id]['form'].tolist()

def _synset_from_id(self, synset_id):

assert(type(synset_id) == int or (type(synset_id) == str and synset_id.is_digit()))
assert(type(synset_id) == int or (type(synset_id) == str and synset_id.isdigit()))
synset_id = str(synset_id)

synset_labels = self.synsets[self.synsets['synset_id'] == synset_id]['label'].tolist()
Expand Down

0 comments on commit cfe657d

Please sign in to comment.