camel_tools.disambig.common¶
This sub-module contains common functions and classes used for disambiguation.
Classes¶
-
class
camel_tools.disambig.common.
ScoredAnalysis
¶ A named tuple containing an analysis and its score.
-
analysis
¶ The analysis dictionary. See CAMeL Morphology Features for more information on features and their values.
Type: dict
-
diac
¶ The diactrized form of the associated analysis. Used for tie-breaking equally scored analyses.
Type: str
-
-
class
camel_tools.disambig.common.
DisambiguatedWord
¶ A named tuple containing a word and a sorted list (from high to low score) of scored analyses.
-
analyses
¶ List of scored analyses sorted from highest to lowest disambiguation score.
Type: list
ofScoredAnalysis
-
-
class
camel_tools.disambig.common.
Disambiguator
¶ Abstract base class that all disambiguators should implement.
-
all_feats
()¶ Return a set of all features produced by this disambiguator.
Returns: The set all features produced by this disambiguator. Return type: frozenset
ofstr
-
disambiguate
(sentence, top=1)¶ Disambiguate words in a sentence.
Parameters: Returns:
list
ofDisambiguatedWord
: List of disambiguted words in sentence.
-
disambiguate_word
(sentence, word_ndx, top=1)¶ Disambiguate a word at a given index in a sentence.
Parameters: Returns:
DisambiguatedWord
: The disambiguated word at index word_ndx in sentence.
-