Skip to content

Commit 3d39c71

Browse files
committed
Rename scan to tokenize #29
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 0d1af80 commit 3d39c71

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/license_expression/_pyahocorasick.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,9 @@ def iter(self, tokens_string, include_unmatched=False, include_space=False):
364364

365365
logger_debug()
366366

367-
def scan(self, string, include_unmatched=True, include_space=False):
367+
def tokenize(self, string, include_unmatched=True, include_space=False):
368368
"""
369-
Scan a string for matched and unmatched sub-sequences and yield non-
369+
tokenize a string for matched and unmatched sub-sequences and yield non-
370370
overlapping Token objects performing a modified Aho-Corasick search
371371
procedure:
372372
@@ -393,7 +393,7 @@ def scan(self, string, include_unmatched=True, include_space=False):
393393
>>> a.add('KL')
394394
>>> a.make_automaton()
395395
>>> string = 'a bcdef ghij kl'
396-
>>> tokens = list(a.scan(string, include_space=True))
396+
>>> tokens = list(a.tokenize(string, include_space=True))
397397
398398
>>> expected = [
399399
... Token(0, 0, u'a', None),
@@ -411,7 +411,7 @@ def scan(self, string, include_unmatched=True, include_space=False):
411411
include_unmatched=include_unmatched, include_space=include_space)
412412
tokens = list(tokens)
413413
if TRACE:
414-
logger_debug('scan.tokens:', tokens)
414+
logger_debug('tokenize.tokens:', tokens)
415415
if not include_space:
416416
tokens = [t for t in tokens if t.string.strip()]
417417
tokens = filter_overlapping(tokens)

0 commit comments

Comments
 (0)