lingpy / lingpy
Showing 3 of 6 files from the diff.

@@ -20,8 +20,8 @@
Loading
20 20
"""
21 21
22 22
__author__ = "Johann-Mattis List, and Robert Forkel (with contributions by Simon J. Greenhill, Tiago Tresoldi, Gereon Kaiping, Steven Moran, Taraka Rama, Johannes Dellert, Frank Nagel, and Peter Bouda, and Taraka Rama)"
23 -
__date__ = "2021-06-07"
24 -
__version__ = "2.6.9.dev0"
23 +
__date__ = "2021-11-26"
24 +
__version__ = "2.6.10.dev0"
25 25
26 26
# We exempt this module from QA, because it only provides import shortcuts.
27 27
# flake8: noqa

@@ -103,10 +103,15 @@
Loading
103 103
    etd2 = wordlist.get_etymdict(ref='cogid', entry='ipa',
104 104
                                      modify_ref=abs)
105 105
106 +
106 107
    assert (len(etd1) > len(etd2) and
107 108
            len(set([abs(x) for x in etd1])) == len(etd2))
108 109
    assert len([x for x in etd2 if x < 0]) == 0
109 110
111 +
    # test iter_cognates
112 +
    for cogid, idxs in wordlist.iter_cognates("cogid"):
113 +
        assert len(idxs) == 1
114 +
110 115
    # make "fuzzy" cognate sets
111 116
    wordlist.add_entries('fuzzyid', 'cogid', lambda x: [x])
112 117

@@ -555,6 +555,16 @@
Loading
555 555
556 556
        return paps
557 557
558 +
    def iter_cognates(self, ref, *entries):
559 +
        """Iterate over cognate sets in a wordlist."""
560 +
        for cogid, idxs_ in self.get_etymdict(ref=ref).items():
561 +
            idxs = []
562 +
            for idx in idxs_:
563 +
                if idx:
564 +
                    idxs += idx
565 +
            yield cogid, [idxs]+[
566 +
                    [self[idx, entry] for idx in idxs] for entry in entries]
567 +
558 568
    def iter_rows(self, *entries):
559 569
        """Iterate over the columns in a wordlist.
560 570
        
Files Coverage
src/lingpy 87.62%
tests 98.86%
Project Totals (123 files) 89.28%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading