99d0fb1a8a00c80c97271b2cc58d52c4fcff0032,jieba/__init__.py,Tokenizer,load_userdict,#Tokenizer#Any#,347
Before Change
freq = tup[1]
else:
tag = tup[1]
elif len(tup) > 2:
freq, tag = tup[1], tup[2]
self.add_word(tup[0], freq, tag)
except Exception:
raise ValueError(
"invalid dictionary entry in %s at Line %s: %s" % (
After Change
f = open(f, "rb")
for lineno, ln in enumerate(f, 1):
line = ln.strip()
if not isinstance(f, text_type):
try:
line = line.decode("utf-8").lstrip("\ufeff")
except UnicodeDecodeError:
raise ValueError("dictionary file %s must be utf-8" % f.name)
if not line:
continue
// match won"t be None because there"s at least one character
word, freq, tag = re_userdict.match(line).groups()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: fxsjy/jieba
Commit Name: 99d0fb1a8a00c80c97271b2cc58d52c4fcff0032
Time: 2015-11-09
Author: abcdoyle888@gmail.com
File Name: jieba/__init__.py
Class Name: Tokenizer
Method Name: load_userdict
Project Name: Microsoft/nni
Commit Name: acc311dd3e15135ca35f69b0183e5b0f9f4beadf
Time: 2019-04-27
Author: 15094695770@163.com
File Name: tools/nni_gpu_tool/gpu_metrics_collector.py
Class Name:
Method Name: check_ready_to_run
Project Name: samuelclay/NewsBlur
Commit Name: aee018f39c813bb3ff12f67f19022d5c584f629b
Time: 2017-01-25
Author: samuel@ofbrooklyn.com
File Name: vendor/readability/encoding.py
Class Name:
Method Name: get_encoding