Word Linker

This module offers the ability to establish relationships between BaseWord instances and BaseAuthor instances. This is done via the WordLinker class which provides methods to check and add parent-child relationships between words and associate authors with words.

class loglan_core.addons.word_linker.WordLinker[source]

Bases: object

This class provides methods to manage parent-child relationships between words and to associate authors with words.

static add_author(word, author)[source]

Associates an ‘author’ with a ‘word’, indicating that the author has contributed to the word.

Parameters:
  • word (BaseWord) – The word to be associated with the author.

  • author (BaseAuthor) – The author to be associated with the word.

Returns:

The abbreviation of the author’s name.

Return type:

str

static add_authors(word, authors)[source]

Associates multiple ‘authors’ with a ‘word’, indicating that these authors have contributed to the word.

Parameters:
  • word (BaseWord) – The word to be associated with the authors.

  • authors (list[BaseAuthor]) – The authors to be associated with the word.

classmethod add_child(parent, child)[source]

Associates a ‘child’ word with a ‘parent’ word, indicating that the child is derived from the parent.

Parameters:
  • parent (BaseWord) – The original word.

  • child (BaseWord) – The word derived from the parent.

Returns:

The name of the child word.

Return type:

str

Raises:

TypeError – If the child word is not parentable.

static add_children(parent, children)[source]

Associates multiple ‘children’ words with a ‘parent’ word, indicating that those children are derived from the parent.

Parameters:
  • parent (BaseWord) – The original word.

  • children (list[BaseWord]) – The words derived from the parent.

Raises:

TypeError – If any of the children words are not parentable.