Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Explicitly test filter_fn against None
Browse files Browse the repository at this point in the history
  • Loading branch information
leezu authored Jun 3, 2019
1 parent 7c6c713 commit 5a000eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gluonnlp/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def __init__(self, filename, encoding='utf8', filter_fn=None):
for idx, line in enumerate(in_file):
line = line.strip()
# check if the line should be filtered out
if filter_fn and not filter_fn(idx, line):
if filter_fn is not None and not filter_fn(idx, line):
continue
lines.append(line)
super(TextLineDataset, self).__init__(lines)
Expand Down

0 comments on commit 5a000eb

Please sign in to comment.