1dfa6c004e1ddb171725910ad38fe83814f6ad0f,pycorrector/__init__.py,,,#,283

Before Change


if __name__ == "__main__":
    line = "少先队员因该为老人让坐"
    // line = "机七学习是人工智能领遇最能体现智能的"
    print("input sentence is:", line)
    corrected_sent, detail = correct(line)
    print("corrected_sent:", corrected_sent)
    print("detail:", detail)

After Change




cn_char_set = load_word_dict(char_file_path)
same_pinyin_text_path = os.path.join(pwd_path, config.same_pinyin_text_path)
same_pinyin_model_path = os.path.join(pwd_path, config.same_pinyin_model_path)
// 同音字
if os.path.exists(same_pinyin_model_path):
    same_pinyin = load_pkl(same_pinyin_model_path)
else:
    default_logger.debug("load same pinyin from text file:", same_pinyin_text_path)
    same_pinyin = load_same_pinyin(same_pinyin_text_path)
    dump_pkl(same_pinyin, same_pinyin_model_path)

// 形似字
same_stroke_text_path = os.path.join(pwd_path, config.same_stroke_text_path)
same_stroke_model_path = os.path.join(pwd_path, config.same_stroke_model_path)
if os.path.exists(same_stroke_model_path):
    same_stroke = load_pkl(same_stroke_model_path)
else:
    default_logger.debug("load same stroke from text file:", same_stroke_text_path)
    same_stroke = load_same_stroke(same_stroke_text_path)
    dump_pkl(same_stroke, same_stroke_model_path)


def get_same_pinyin(char):
    
    取同音字
    :param char:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: shibing624/pycorrector
Commit Name: 1dfa6c004e1ddb171725910ad38fe83814f6ad0f
Time: 2018-03-14
Author: 507153809@qq.com
File Name: pycorrector/__init__.py
Class Name:
Method Name:


Project Name: shibing624/pycorrector
Commit Name: 1dfa6c004e1ddb171725910ad38fe83814f6ad0f
Time: 2018-03-14
Author: 507153809@qq.com
File Name: pycorrector/__init__.py
Class Name:
Method Name:


Project Name: automl/auto-sklearn
Commit Name: 3c10c9c57100291107db39e7c830de8f3b7f1334
Time: 2019-02-07
Author: ahn1340@hotmail.com
File Name: scripts/2015_nips_paper/score_metalearning.py
Class Name:
Method Name: main


Project Name: automl/auto-sklearn
Commit Name: 96574b47a58b0f3dc4a5b085086ca07a173d432b
Time: 2019-03-13
Author: ahn1340@hotmail.com
File Name: scripts/2015_nips_paper/score_metalearning.py
Class Name:
Method Name: main