Skip to content

Commit

Permalink
JapaneseTokenizer.pipe added (#6515)
Browse files Browse the repository at this point in the history
* JapaneseTokenizer.pipe added

For [spacymoji](https://spacy.io/universe/project/spacymoji)  with `Japanese()`.

* DummyTokenizer.pipe added instead
  • Loading branch information
KoichiYasuoka committed Dec 8, 2020
1 parent df4891b commit 0afb54a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spacy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,13 @@ def update(self, other):


class DummyTokenizer(object):
def __call__(self, text):
raise NotImplementedError

def pipe(self, texts, **kwargs):
for text in texts:
yield self(text)

# add dummy methods for to_bytes, from_bytes, to_disk and from_disk to
# allow serialization (see #1557)
def to_bytes(self, **kwargs):
Expand Down

0 comments on commit 0afb54a

Please sign in to comment.