Skip to content

Commit

Permalink
Declare ngram variable in select_ngrams
Browse files Browse the repository at this point in the history
    * This is to avoid an undeclared variable issue when running the last part of the function

Signed-off-by: Jono Yang <jyang@nexb.com>
  • Loading branch information
JonoYang committed Oct 23, 2024
1 parent 6e42937 commit 1983426
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/licensedcode/tokenize.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ def select_ngrams(ngrams, with_pos=False):
>>> list(select_ngrams(x for x in [(2, 1, 3), (1, 1, 3), (5, 1, 3), (2, 6, 1), (7, 3, 4)]))
[(2, 1, 3), (1, 1, 3), (5, 1, 3), (2, 6, 1), (7, 3, 4)]
"""
ngram = None
last = None
for pos, ngram in enumerate(ngrams):
# FIXME: use a proper hash
Expand Down

0 comments on commit 1983426

Please # to comment.