Internal API reference

Lexedata is a set of tools for managing, editing, and annotating large lexical datasets in CLDF.

Lexedata is open access software in development. Please report any problems and suggest any improvements you would like to see by opening an issue on the Lexedata GitHub repository

lexedata.cli module

class lexedata.cli.ChangeLoglevel(option_strings, dest, const, nargs=None, **kwargs)

Bases: Action

class lexedata.cli.Exit(value)

Bases: IntEnum

An enumeration.

CLI_ARGUMENT_ERROR = 2
FILE_NOT_FOUND = 10
INVALID_COLUMN_NAME = 6
INVALID_DATASET = 8
INVALID_ID = 5
INVALID_INPUT = 9
INVALID_TABLE_NAME = 7
NO_COGNATETABLE = 3
NO_SEGMENTS = 4
class lexedata.cli.SetOrFromFile(option_strings, dest, nargs='+', default=<lexedata.types.WorldSet object>, help=None, autohelp=True, metavar=None, **kwargs)

Bases: Action

lexedata.cli.add_log_controls(parser: ArgumentParser)
lexedata.cli.enum_from_lower(enum: Type[Enum])
lexedata.cli.parser(name: str, description: str, **kwargs) ArgumentParser
lexedata.cli.setup_logging(args: Namespace)
lexedata.cli.tq(iter, task, logger=<Logger lexedata (INFO)>, total: ~typing.Optional[~typing.Union[int, float]] = None)

lexedata.error_handling module

exception lexedata.error_handling.MultipleCandidatesWarning

Bases: UserWarning

exception lexedata.error_handling.ObjectNotFoundWarning

Bases: UserWarning

lexedata.error_handling.create(db_object: Dict[str, Any], cell: Optional[str] = None) bool

Should I add a missing object? Yes, quietly.

Give permission to add the object.

Returns:

True

Return type:

The object should be added.

lexedata.error_handling.error(db_object: Dict[str, Any], cell: Optional[str] = None) bool

Should I add a missing object? No, the object missing is an error.

Raise an exception (ObjectNotFoundWarning) reporting the missing object and cell.

Raises:

ObjectNotFoundWarning

lexedata.error_handling.ignore(db_object: Dict[str, Any], cell: Optional[str] = None) bool

Should I add a missing object? No, drop it quietly.

Returns:

False

Return type:

The object should not be added.

lexedata.error_handling.warn(db_object: Dict[str, Any], cell: Optional[str] = None) bool

Should I add a missing object? No, but inform the user.

Send a warning (ObjectNotFoundWarning) reporting the missing object and cell.

Returns:

False

Return type:

The object should not be added.

lexedata.error_handling.warn_and_create(db_object: Dict[str, Any], cell: Optional[str] = None) bool

Should I add a missing object? Yes, but inform the user.

Send a warning (ObjectNotFoundWarning) reporting the missing object and cell, and give permission to add the object.

Returns:

True

Return type:

The object should be added.

lexedata.types module

class lexedata.types.CogSet

Bases: RowObject

cognate set

class lexedata.types.Concept

Bases: RowObject

concept

class lexedata.types.Form

Bases: Object

form

class lexedata.types.Judgement

Bases: RowObject

cognate judgement

class lexedata.types.KeyKeyDict

Bases: Mapping[str, str]

class lexedata.types.Language

Bases: Object

language

class lexedata.types.Object

Bases: Dict[str, Any]

class lexedata.types.Reference

Bases: Object

reference

class lexedata.types.RowObject

Bases: Object

A row in a lexical dataset, i.e. a concept or cognateset

class lexedata.types.Source

Bases: Object

source

class lexedata.types.Wordlist(tablegroup: TableGroup)

Bases: Wordlist, Generic[Language_ID, Form_ID, Parameter_ID, Cognate_ID, Cognateset_ID]

class lexedata.types.WorldSet

Bases: Generic[H]

intersection(other: Union[WorldSet[H], Set[H]]) Union[WorldSet[H], Set[H]]