Skip to content

Commit

Permalink
fix: rglob
Browse files Browse the repository at this point in the history
  • Loading branch information
severinsimmler committed Dec 23, 2018
1 parent d97ee7e commit 4e944ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cophi/api.py
Expand Up @@ -33,7 +33,7 @@ def document(filepath, **kwargs):
return cophi.model.Document(textfile.content, **kwargs)


def corpus(directory, filepath_pattern="*.*", treat_as=None, encoding="utf-8",
def corpus(directory, filepath_pattern="*", treat_as=None, encoding="utf-8",
lowercase=True, n=None, token_pattern=r"\p{L}+\p{P}?\p{L}+",
maximum=None):
"""Pipe a collection of text files and create a Corpus object.
Expand All @@ -53,7 +53,7 @@ def corpus(directory, filepath_pattern="*.*", treat_as=None, encoding="utf-8",
"""
if not isinstance(directory, pathlib.Path):
directory = pathlib.Path(directory)
filepaths = directory.glob(filepath_pattern)
filepaths = directory.rglob(filepath_pattern)

def lazy_reading(filepaths):
for filepath in filepaths:
Expand Down

0 comments on commit 4e944ea

Please sign in to comment.