038515ccfb6df094e22b9f14fcf9d8c391bc4eaa,torchtext/data/utils.py,,ngrams_iterator,#Any#Any#,117
Before Change
>>> ["here", "here we", "we", "we are", "are"]
for i in range(0, len(token_list)):
x = token_list[i]
yield x
for j in range(i + 1, min(i + ngrams, len(token_list))):
x += " " + token_list[j]
yield x
class RandomShuffler(object):
Use random functions while keeping track of the random state to make it
reproducible and deterministic.
After Change
for x in token_list:
yield x
for n in range(2, ngrams + 1):
for x in _get_ngrams(n):
yield " ".join(x)
class RandomShuffler(object):
Use random functions while keeping track of the random state to make it
reproducible and deterministic.
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: pytorch/text
Commit Name: 038515ccfb6df094e22b9f14fcf9d8c391bc4eaa
Time: 2019-07-26
Author: cpuhrsch@fb.com
File Name: torchtext/data/utils.py
Class Name:
Method Name: ngrams_iterator
Project Name: prody/ProDy
Commit Name: f0961db7e1cb3ae73e5fac0b9de1d5ce308a7ea7
Time: 2012-12-15
Author: lordnapi@gmail.com
File Name: lib/prody/sequence/msa.py
Class Name: MSA
Method Name: __iter__
Project Name: mathics/Mathics
Commit Name: f592ce49086098fe835de68a7ee7bf49967b14ad
Time: 2016-08-22
Author: Bernhard.Liebl@gmx.org
File Name: mathics/algorithm/clusters.py
Class Name:
Method Name: _shuffled_range