Package jazzparser :: Module grammar :: Class MorphItem
[hide private]
[frames] | no frames]

Class MorphItem

source code

object --+
         |
        MorphItem

A morphological item - a word. Stores the word and the POS. Words are stored as strings, unlike in OpenCCG. We don't need all the extra information about words that OpenCCG holds.

The word field stores a list of strings, defining all the words represented by this morph item. In the case of a <entry pos="POS" word="WORD"/> item, this is a single word, but in the case of a <entry pos="POS" class="CLASS"/> item, this is all the words contained in the class CLASS.

The argument classes should be a dictionary mapping class names to ChordClass objects, for all the classes that have been read in for the grammar.

Instance Methods [hide private]
 
__init__(self, formalism, words, pos, optional_minor=None, chord_class=None, mark_class=True)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__str__(self)
str(x)
source code
 
__repr__(self)
repr(x)
source code
 
__get_desc(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Static Methods [hide private]
 
from_dom(formalism, element, classes, mark_class=True)
Builds a MorphItem instance from a DOM XML specification.
source code
Properties [hide private]
  desc

Inherited from object: __class__

Method Details [hide private]

__init__(self, formalism, words, pos, optional_minor=None, chord_class=None, mark_class=True)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

Property Details [hide private]

desc

Get Method:
__get_desc(self)