4197dfb8fa62574a86ec09fa5ddc33fd117d6464,jieba/__init__.py,,add_word,#Any#Any#Any#,315

Before Change


@require_initialized
def add_word(word, freq, tag=None):
    global FREQ, pfdict, total, user_word_tag_tab
    FREQ[word] = log(float(freq) / total)
    if tag is not None:
        user_word_tag_tab[word] = tag.strip()
    for ch in range(len(word)):
        pfdict.add(word[:ch+1])

After Change


@require_initialized
def add_word(word, freq, tag=None):
    global FREQ, pfdict, total, user_word_tag_tab
    freq = int(freq)
    FREQ[word] = freq
    total += freq
    if tag is not None:
        user_word_tag_tab[word] = tag
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: fxsjy/jieba
Commit Name: 4197dfb8fa62574a86ec09fa5ddc33fd117d6464
Time: 2015-02-09
Author: abcdoyle888@gmail.com
File Name: jieba/__init__.py
Class Name:
Method Name: add_word


Project Name: lanpa/tensorboardX
Commit Name: 6671c4e3a6b477f04e1d74ada3b5285de39ba2e6
Time: 2018-06-08
Author: 14957047+ml7@users.noreply.github.com
File Name: tensorboardX/x2num.py
Class Name:
Method Name: _prepare_video


Project Name: google/mozc-devices
Commit Name: 8ced8527c93c4c1af5255f5e960ddd36ec0e5c14
Time: 2018-09-10
Author: shimazu@google.com
File Name: mozc-nazoru/src/nazoru/keyboard_recorder.py
Class Name: KeyboardRecorderFromConsole
Method Name: _read_ansi_escape