danoan.word_def.core.model module
Data models and interfaces.
- class danoan.word_def.core.model.Plugin(package_name: str, adapter_factory: danoan.word_def.core.model.PluginFactory)[source]
Bases:
object
- Parameters:
package_name (str) –
adapter_factory (PluginFactory) –
- adapter_factory: PluginFactory
- package_name: str
- class danoan.word_def.core.model.PluginFactory(*args, **kwargs)[source]
Bases:
Protocol
- get_adapter(configuration_stream: TextIO | None = None) PluginProtocol [source]
Instantiate an implementation of PluginProtocol according with the configuration file.
- Raises:
ConfigurationFileRequiredError if api needs configurations settings but a toml configuration file is not passed. –
- Parameters:
configuration_stream (TextIO | None) –
- Return type:
- class danoan.word_def.core.model.PluginProtocol(*args, **kwargs)[source]
Bases:
Protocol
- get_definition(word: str) Sequence[str] [source]
- Raises:
UnexpectedResponseError if status code of request is different from 200. –
- Parameters:
word (str) –
- Return type:
Sequence[str]
- get_pos_tag(word: str) Sequence[PosTag] [source]
Get part-of-speech tag of the given word.
The first tag correspond to the first entry in the dictionary.
- Parameters:
word (str) –
- Return type:
Sequence[PosTag]
- class danoan.word_def.core.model.PosTag(value)[source]
Bases:
Enum
Part-of-speech tags as defined in: https://universaldependencies.org/u/pos/all.html
- Adjective = 'Adjective'
- Adposition = 'Adposition'
- Adverb = 'Adverb'
- Auxiliary = 'Auxiliary'
- Conjunction = 'Conjunction'
- CoordinatingConjunction = 'Coodrinating Conjunction'
- Determiner = 'Determiner'
- Interjection = 'Interjection'
- Noun = 'Noun'
- Numeral = 'Numeral'
- Other = 'Other'
- Particle = 'Particle'
- Pronoun = 'Pronoun'
- ProperNoun = 'Proper Noun'
- Punctuation = 'Punctuation'
- SubordinatingConjunction = 'Subordinating Conjunction'
- Symbol = 'Symbol'
- Verb = 'Verb'