Package nltk_lite :: Package contrib :: Package toolbox :: Module text :: Class Word
[hide private]
[frames] | no frames]

Class Word

source code

This class defines a word object, which consists of fixed number of attributes: a wordform, a gloss, a part of speech, and a list of morphemes.

Instance Methods [hide private]
 
__init__(self, form=None, gloss=None, morphemes=None, partOfSpeech=None)
Constructor that initializes Word object.
source code
 
get_form(self)
Gives the surface form of a word.
source code
 
set_form(self, form)
Changes the surface form of a word.
source code
 
get_gloss(self)
Gives the gloss for a word as a string (without alignment spacing).
source code
 
set_gloss(self, gloss)
Change the gloss for a word.
source code
 
get_morphemes(self)
Gives a list of Morpheme objects for a word.
source code
 
set_morphemes(self, morphemes)
Change a list of Morpheme objects for a word.
source code
 
get_part_of_speech(self)
Gives the part of speech for a word as a string (without alignment spacing).
source code
 
set_part_of_speech(self, partOfSpeech)
Change the part of speech for a word.
source code
 
get_raw_gloss(self) source code
 
set_raw_gloss(self, rawGloss) source code
 
get_raw_morphemes(self) source code
 
set_raw_morphemes(self, rawMorphemes) source code
 
get_raw_part_of_speech(self) source code
 
set_raw_part_of_speech(self, rawPartOfSpeech) source code
Method Details [hide private]

__init__(self, form=None, gloss=None, morphemes=None, partOfSpeech=None)
(Constructor)

source code 

Constructor that initializes Word object.

Parameters:
  • form (string) - the surface form for a word
  • gloss (string) - the gloss for a word
  • morphemes (list) - list of Morpheme objects for a word
  • partOfSpeech (string) - the part of speech for a word