Data models

Basic models.

class cltoolkit.models.CLCore(id, wordlist=None, data=None)[source]

Base class to represent data in a wordlist.

class cltoolkit.models.WithForms(forms=None)[source]

Mixin to represent data in a wordlist that contains forms.

class cltoolkit.models.WithDataset(obj=None, dataset=None)[source]

Mixin to represent data in a wordlist from a specific dataset.

class cltoolkit.models.Language(id, wordlist=None, data=None, forms=None, obj=None, dataset=None, senses=None, concepts=None)[source]

Base class for handling languages.

Variables
  • sensesDictTuple of senses, i.e. glosses for forms.

  • conceptsDictTuple of senses with explicit Concepticon mapping.

  • glottocodestr, Glottocode for the language.

Note

A language variety is defined for a specific dataset only.

class cltoolkit.models.Sense(id, wordlist=None, data=None, forms=None, obj=None, dataset=None, language=None)[source]

A sense description (concept in source) which does not need to be linked to the Concepticon.

Variables
  • languageLanguage instance

  • namestr, the gloss

Note

Unlike senses in a wordlist, which are dataset-specific, concepts in a wordlist are defined for all datasets.

class cltoolkit.models.Concept(id, wordlist=None, data=None, forms=None, language=None, senses=None, name=None, concepticon_id=None, concepticon_gloss=None)[source]

Base class for the concepts in a dataset.

Variables
  • languageLanguage instance

  • namestr, the gloss

  • sensesiterable of senses mapped to this concept

  • concepticon_idstr ID of the Concepticon concept set the concept is mapped to.

  • concepticon_glossstr gloss of the Concepticon concept set the concept is mapped to.

Note

Unlike senses in a wordlist, which are dataset-specific, concepts in a wordlist are defined for all datasets. As a result, they lack a reference to the original dataset in which they occur, but they have an attribute senses which is a reference to the original senses as they occur in different datasets.

class cltoolkit.models.Form(id, wordlist=None, data=None, obj=None, dataset=None, concept=None, language=None, sense=None, sounds=NOTHING, cognates=NOTHING)[source]

Base class for handling the form part of linguistic signs.

Variables
  • concept – The concept (if any) expressed by the form.

  • language – The language in which the form occurs.

  • sense – The meaning expressed by the form.

  • sounds – The segmented strings defined by the B(road) IPA.

  • graphemes – The segmented graphemes (possibly not BIPA conform).

sounds

Sounds (graphemes recognized in the specified transcription system) in the segmented form:

graphemes

Graphemes in the segmented form:

class cltoolkit.models.Cognate(id, wordlist=None, data=None, obj=None, dataset=None, form=None, contribution=None)[source]
class cltoolkit.models.Grapheme(id, wordlist=None, data=None, obj=None, dataset=None, forms=None, grapheme=None, occurrences=None, language=None)[source]
class cltoolkit.models.Sound(id, wordlist=None, data=None, forms=None, grapheme=None, occurrences=None, graphemes_in_source=None, language=None, obj=None)[source]

All sounds in a dataset.