fceb1968e44aa10654144aa0ca0a75adc46e13e2,lingpy/meaning/colexification.py,,_get_statistics,#Any#Any#Any#Any#,44
Before Change
if family not in wordlist.header:
family = "doculect"
statistics = {}
for k in wordlist:
tmp_concept = wordlist[k, concept]
tmp_entry = wordlist[k, entry]
tmp_family = wordlist[k, family]
tmp_taxon = wordlist[k, "taxon"]
try:
statistics[tmp_concept]["families"] += [tmp_family]
statistics[tmp_concept]["doculects"] += [tmp_taxon]
statistics[tmp_concept]["words"] += [tmp_entry]
except KeyError:
statistics[tmp_concept] = dict(
families=[tmp_family],
doculects=[tmp_taxon],
words=[tmp_entry])
for k in statistics:
statistics[k]["familyOcc"] = len(set(statistics[k]["families"]))
statistics[k]["doculectOcc"] = len(set(statistics[k]["doculects"]))
statistics[k]["wordOcc"] = len(statistics[k]["words"])
After Change
if family not in wordlist.header:
family = "doculect"
statistics = defaultdict(lambda: defaultdict(list))
for k in wordlist:
tmp_concept = wordlist[k, concept]
statistics[tmp_concept]["families"].append(wordlist[k, family])
statistics[tmp_concept]["doculects"].append(wordlist[k, "taxon"])
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances Project Name: lingpy/lingpy
Commit Name: fceb1968e44aa10654144aa0ca0a75adc46e13e2
Time: 2016-03-11
Author: xrotwang@googlemail.com
File Name: lingpy/meaning/colexification.py
Class Name:
Method Name: _get_statistics
Project Name: lingpy/lingpy
Commit Name: fceb1968e44aa10654144aa0ca0a75adc46e13e2
Time: 2016-03-11
Author: xrotwang@googlemail.com
File Name: lingpy/meaning/colexification.py
Class Name:
Method Name: _get_colexifications_by_taxa
Project Name: lingpy/lingpy
Commit Name: fceb1968e44aa10654144aa0ca0a75adc46e13e2
Time: 2016-03-11
Author: xrotwang@googlemail.com
File Name: lingpy/meaning/colexification.py
Class Name:
Method Name: partition_colexifications