sudachipy.morpheme package
Note
- Import from
sudachipy.morpheme
is deprecated. Use
from sudachipy import Morpheme
instead.
- Import from
Method
Morpheme.get_word_info(self) -> WordInfo
is deprecated.
Module contents
- class sudachipy.morpheme.Morpheme
- begin($self) int
–
Returns the begin index of this in the input text
- dictionary_form($self) str
–
Returns the dictionary form
- dictionary_id($self) int
–
Returns the dictionary id which this word belongs
- end($self) int
–
Returns the end index of this in the input text
- get_word_info($self) sudachipy.WordInfo
–
Returns the word info
- is_oov($self) bool
–
Returns whether if this is out of vocabulary word
- normalized_form($self) str
–
Returns the normalized form
- part_of_speech()
Returns the part of speech as a six-element tuple. Tuple elements are four POS levels, conjugation type and conjugation form.
- part_of_speech_id($self) int
–
Returns the id of the part of speech in the dictionary
- raw_surface($self) str
–
Returns the substring of input text corresponding to the morpheme regardless the configured projection
- reading_form($self) str
–
Returns the reading form
- split($self, mode, out = None, add_single = False) sudachipy.MorphemeList
–
Returns sub-morphemes in the provided split mode.
- Parameters:
mode (sudachipy.SplitMode) – mode of new split
out (Optional[sudachipy.MorphemeList]) – write results to this MorhpemeList instead of creating new one See https://worksapplications.github.io/sudachi.rs/python/topics/out_param.html for more information on output parameters. Returned MorphemeList will be invalidated if this MorphemeList is used as an output parameter.
add_single (bool) – return lists with the current morpheme if the split hasn’t produced any elements. When False is passed, empty lists are returned instead.
- surface($self) str
–
Returns the substring of input text corresponding to the morpheme, or a projection if one is configured
- synonym_group_ids($self) List[int]
–
Returns the list of synonym group ids
- word_id($self) int
–
Returns word id of this word in the dictionary