Coverage for lingpy/evaluate/alr.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# *-* coding: utf-8 *-* Module provides methods for the evaluation of automatic linguistic reconstruction analyses. """
wordlist, gold="proto", test="consensus", ref="cogid", tokens=True, classes=False, **keywords): """ Function computes the edit distance between gold standard and test set.
Parameters ---------- wordlist : ~lingpy.basic.wordlist.Wordlist The wordlist object containing the data for a given analysis. gold : str (default="proto") The name of the column containing the gold-standard solutions. test = "consensus" The name of the column containing the test solutions.
stress : str (default=rcParams['stress']) A string containing the stress symbols used in the sound-class conversion. Defaults to the stress as defined in ~lingpy.settings.rcParams.
diacritics : str (default=rcParams['diacritics']) A string containing diacritic symbols used in the sound-class conversion. Defaults to the diacritic symbolds defined in ~lingpy.settings.rcParams.
cldf : bool (default=False) If set to True, this will allow for a specific treatment of phonetic symbols which cannot be completely resolved (e.g., laryngeal h₂ in Indo-European). Following the `CLDF <http://cldf.clld.org>`_ specifications (in particular the specifications for writing transcriptions in segmented strings, as employed by the `CLTS <http://calc.digling.org/clts/>`_ initiative), in cases of insecurity of pronunciation, users can adopt a ```source/target``` style, where the source is the symbol used, e.g., in a reconstruction system, and the target is a proposed phonetic interpretation. This practice is also accepted by the `EDICTOR <http://edictor.digling.org>`_ tool.
Returns ------- dist : float The mean edit distance between gold and test reconstructions.
Notes ----- This function has an alias ("med"). Calling it will produce the same results. """ keywords, merge_vowels=rcParams['merge_vowels'], model=rcParams['model'], stress=rcParams['stress'], diacritics=rcParams['diacritics'], cldf=False)
# get only valid numbers for index-search
# get proto and consensus from wordlist
diacritics=keywords['diacritics'], cldf=keywords['cldf']) stress=keywords['stress'], diacritics=keywords['diacritics'], cldf=keywords['cldf'])
# alias for mean_edit_distance |