500da80c20050a442633fb8263ef0993f02e90a2,stanfordnlp/models/common/conll.py,CoNLLFile,load_conll,#CoNLLFile#,32
Before Change
infile = io.StringIO(self.file)
else:
infile = open(self.file)
while True:
line = infile.readline()
if len(line) == 0:
break
line = line.strip()
if len(line) == 0:
if len(cache) > 0:
sents.append(cache)
cache = []
else:
if line.startswith("//"): // skip comment line
continue
array = line.split("\t")
if self.ignore_gapping and "." in array[0]:
continue
assert len(array) == FIELD_NUM
cache += [array]
if len(cache) > 0:
sents.append(cache)
if not self._from_str:
infile.close()
After Change
else:
infile = open(self.file)
with infile:
for line in infile:
line = line.strip()
if len(line) == 0:
if len(cache) > 0:
sents.append(cache)
cache = []
else:
if line.startswith("//"): // skip comment line
continue
array = line.split("\t")
if self.ignore_gapping and "." in array[0]:
continue
assert len(array) == FIELD_NUM
cache += [array]
if len(cache) > 0:
sents.append(cache)
return sents
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: stanfordnlp/stanza
Commit Name: 500da80c20050a442633fb8263ef0993f02e90a2
Time: 2019-02-19
Author: lawrencews@jhu.edu
File Name: stanfordnlp/models/common/conll.py
Class Name: CoNLLFile
Method Name: load_conll
Project Name: google/language-resources
Commit Name: d27dc7e0e3f76b021e5cff2d63466c415d4b3f74
Time: 2017-11-12
Author: mjansche@google.com
File Name: utils/icu_util.py
Class Name:
Method Name: TestRulesInteractively
Project Name: google/language-resources
Commit Name: 1fdb64d8d36ea4a84a5acf0281f18fe63559c681
Time: 2017-11-12
Author: mjansche@google.com
File Name: utils/evaluate_pronunciation_rules.py
Class Name:
Method Name: ApplyPronunciationRules