b3349272475868db067a4e01795e19d3b9e57c63,pycorrector/cn_spell.py,,correct,#Any#Any#,87
Before Change
for phrase in seg_list:
corrected_phrase = phrase
if phrase not in PUNCTUATION_LIST:
if phrase not in phrase_freq.keys():
corrected_phrase = correct_phrase(phrase)
if verbose:
print(phrase, "=>", corrected_phrase)
correct_sentence += corrected_phrase
return correct_sentence
After Change
for word in seg_words:
corrected_word = word
if word not in PUNCTUATION_LIST:
if word not in word_freq.keys():
corrected_word = correct_word(word)
loc = sentence.find(word)
locations.append(loc)
wrong_words.append(word)
right_words.append(corrected_word)
if verbose:
print("pred:", word, "=>", corrected_word, ", index:", loc)
correct_sentence += corrected_word
correct_detail = zip(locations, wrong_words, right_words)
return correct_sentence, correct_detail
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: shibing624/pycorrector
Commit Name: b3349272475868db067a4e01795e19d3b9e57c63
Time: 2018-03-07
Author: xuming624@qq.com
File Name: pycorrector/cn_spell.py
Class Name:
Method Name: correct
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c35b902f44627bc53be6152092bc60ae82b1fe2e
Time: 2020-08-25
Author: abigailt@il.ibm.com
File Name: art/attacks/inference/membership_inference.py
Class Name: MembershipInferenceBlackBox
Method Name: fit
Project Name: studioml/studio
Commit Name: e67bdcc03032345f00105928da1d832f8514cbd3
Time: 2017-10-17
Author: peter.zhokhov@sentient.ai
File Name: studio/firebase_artifact_store.py
Class Name: FirebaseArtifactStore
Method Name: __init__