751ff35eb5faa6460038bb20a1ef6bfcf29f440a,jieba/analyse/__init__.py,,extract_tags,#Any#Any#Any#,62

Before Change


            continue
        freq[w] = freq.get(w, 0.0) + 1.0
    total = sum(freq.values())
    freq = [(k,v/total) for k,v in freq.iteritems()]

    tf_idf_list = [(v*idf_freq.get(k,median_idf), k) for k,v in freq]
    st_list = sorted(tf_idf_list, reverse=True)

    if withWeight:
        tags = st_list[:topK]
    else:
        top_tuples = st_list[:topK]
        tags = [a[1] for a in top_tuples]
    return tags

After Change


    else:
        tags = sorted(freq, key=freq.__getitem__, reverse=True)
    if topK:
        return tags[:topK]
    else:
        return tags
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: fxsjy/jieba
Commit Name: 751ff35eb5faa6460038bb20a1ef6bfcf29f440a
Time: 2014-10-31
Author: abcdoyle888@gmail.com
File Name: jieba/analyse/__init__.py
Class Name:
Method Name: extract_tags


Project Name: matthewwithanm/django-imagekit
Commit Name: 5718c304cfd3a8f0e59ba918ebf9e485d4edc738
Time: 2011-09-21
Author: matthew@exanimo.com
File Name: imagekit/fields.py
Class Name: BoundImageSpec
Method Name: _suggested_extension


Project Name: brian-team/brian2
Commit Name: bb0b34fe488fc125fcd8cbb367db92212ac988b3
Time: 2013-03-26
Author: marcel.stimberg@ens.fr
File Name: brian2/stateupdaters/base.py
Class Name: StateUpdateMethod
Method Name: determine_stateupdater