danoan.word_def.core.api module
Public API.
- class danoan.word_def.core.api.PluginRegister(plugin_register: _PluginRegister)[source]
Bases:
object
Public proxy to _PluginRegister.
- Parameters:
plugin_register (_PluginRegister) –
- danoan.word_def.core.api.api_version() str [source]
Get the version of the word-def package and its protocols.
Version is expected to follow the semantic versioning scheme.
- Return type:
str
- danoan.word_def.core.api.get_definition(word: str, language_code: str, plugin_name: str | None = None, configuration_stream: TextIO | None = None) List[str] [source]
Get a list of definitions for the given word.
- Parameters:
word (str) –
language_code (str) –
plugin_name (str | None) –
configuration_stream (TextIO | None) –
- Return type:
List[str]
- danoan.word_def.core.api.get_pos_tag(word: str, language_code: str, plugin_name: str | None = None, configuration_stream: TextIO | None = None)[source]
Get a list of part-of-speech tags for the given word.
- Parameters:
word (str) –
language_code (str) –
plugin_name (str | None) –
configuration_stream (TextIO | None) –
- danoan.word_def.core.api.get_synonym(word: str, language_code: str, plugin_name: str | None = None, configuration_stream: TextIO | None = None)[source]
Get a list of synonyms to the given word.
- Parameters:
word (str) –
language_code (str) –
plugin_name (str | None) –
configuration_stream (TextIO | None) –
- danoan.word_def.core.api.get_usage_example(word: str, language_code: str, plugin_name: str | None = None, configuration_stream: TextIO | None = None)[source]
Get a list of examples in which the given word is employed.
- Parameters:
word (str) –
language_code (str) –
plugin_name (str | None) –
configuration_stream (TextIO | None) –
- danoan.word_def.core.api.is_plugin_compatible(plugin: PluginFactory) str [source]
Check if word_def and plugin version are compatible.
Versions are compatible if major version components are equal. (see https://semver.org/)
- Parameters:
plugin (PluginFactory) –
- Return type:
str