9c506d35f66914eaf21f8869fe25a5a9e7b8e2f0,tests/e2e/hardware_spaces.py,OmniNgramsTemp,apply,#OmniNgramsTemp#Any#Any#,230
Before Change
def apply(self, session, context):
for ts in OmniNgrams.apply(self, session, context):
m = re.match(
u"^([\+\-\u2010\u2011\u2012\u2013\u2014\u2212\uf02d])?(\s*)(\d+)$",
ts.get_span(),
re.U,
)
if m:
if m.group(1) is None:
temp = ""
elif m.group(1) == "+":
if m.group(2) != "":
continue // If bigram "+ 150" is seen, accept the unigram "150", not both
temp = ""
else: // m.group(1) is a type of negative sign
// A bigram "- 150" is different from unigram "150", so we keep the implicit "-150"
temp = "-"
temp += m.group(3)
yield TemporaryImplicitSpan(
sentence=ts.sentence,
char_start=ts.char_start,
After Change
def apply(self, session, context):
for ts in MentionNgrams.apply(self, session, context):
if ts.get_span().endswith(".0"):
value = ts.get_span()[:-2]
yield TemporaryImplicitSpan(
sentence=ts.sentence,
char_start=ts.char_start,
char_end=ts.char_end,
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances Project Name: HazyResearch/fonduer
Commit Name: 9c506d35f66914eaf21f8869fe25a5a9e7b8e2f0
Time: 2018-07-26
Author: lwhsiao@stanford.edu
File Name: tests/e2e/hardware_spaces.py
Class Name: OmniNgramsTemp
Method Name: apply
Project Name: sloria/TextBlob
Commit Name: 7ef05274835b2272b1b431d3633d0559db684197
Time: 2015-06-08
Author: jschnurr@gmail.com
File Name: textblob/translate.py
Class Name: Translator
Method Name: _get_translation_from_json5
Project Name: sloria/TextBlob
Commit Name: 7ef05274835b2272b1b431d3633d0559db684197
Time: 2015-06-08
Author: jschnurr@gmail.com
File Name: textblob/translate.py
Class Name: Translator
Method Name: _get_language_from_json5