LingPy

This documentation is for version 2.0.dev, which is not released yet.

lingpy.basic.wordlist.Wordlist

class lingpy.basic.wordlist.Wordlist(filename, row='concept', col='doculect', conf='')

Basic class for the handling of multilingual word lists.

Parameters :

filename : { string dict }

The input file that contains the data. Otherwise a dictionary with consecutive integers as keys and lists as values with the key 0 specifying the header.

row : str (default = “concept”)

A string indicating the name of the row that shall be taken as the basis for the tabular representation of the word list.

col : str (default = “doculect”)

A string indicating the name of the column that shall be taken as the basis for the tabular representation of the word list.

conf : string (default=’‘)

A string defining the path to the configuration file.

Notes

A word list is created from a dictionary containing the data. Two keywords (row and col) define, which of the dimensions of the original data should be used as row and as column of the tabular display. A configuration file can be used to change basic names and aliases for the data being used, and the classes (data types) of the entries.

A couple of methods is provided along with the word list class in order to access the multi-dimensional input data. The main idea is to provide an easy way to access two-dimensional slices of the data by specifying which entry type should be returned. Thus, if a word list consists not only of simple orthographical entries but also of IPA encoded phonetic transcriptions, both the orthographical source and the IPA transcriptions can be easily accessed as two separate two-dimensional lists.

Methods

add_entries(entry, source, function[, override]) Add new entry-types to the word list by modifying given ones.
calculate(data[, taxa, concepts, cognates, ...]) Function calculates specific data.
get_dict([col, row, entry]) Function returns dictionaries of the cells matched by the indices.
get_entries(entry) Return all entries matching the given entry-type as a two-dimensional list.
get_etymdict([ref, entry, loans]) Return an etymological dictionary representation of the word list.
get_list([row, col, entry, flat]) Function returns lists of rows and columns specified by their name.
get_paps([ref, entry, missing]) Function returns a list of present-absent-patterns of a given word list.
output(fileformat, **keywords) Write wordlist to file.
pickle() Store a dump of the data in a binary file.
tokenize([ortho_profile, source, target]) Tokenize the data with help of orthography profiles.

This Page