Skip to content

Commit

Permalink
fix pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
pavaris-pm committed Dec 5, 2023
1 parent 42f60c4 commit ee85e1b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pythainlp/corpus/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ def path_pythainlp_corpus(filename: str) -> str:
return os.path.join(corpus_path(), filename)


def get_corpus(filename: str, as_is: bool = False, discard_comments: bool = False) -> Union[frozenset, list]:
def get_corpus(filename: str,
as_is: bool = False,
discard_comments: bool = False
) -> Union[frozenset, list]:
"""
Read corpus data from file and return a frozenset or a list.
Expand Down Expand Up @@ -117,8 +120,8 @@ def get_corpus(filename: str, as_is: bool = False, discard_comments: bool = Fals
# remove license since some are included in the returned corpus
lines = [word for word in lines if 'SPDX' not in word]

if discard_comments:
lines = [word for word in lines if '#' not in word]
if discard_comments:
lines = [word for word in lines if '#' not in word]

return frozenset(filter(None, lines))

Expand Down

0 comments on commit ee85e1b

Please sign in to comment.