Module BasicClasses :: Class Sentences
[show private | hide private]
[frames | no frames]

Class Sentences

    object --+    
             |    
      BIObject --+
                 |
    object --+   |
             |   |
BIXMLWriteable --+
                 |
                Sentences


Sentences holds the sentences of the corpus. One instance corresponds to one XML tag sentences.
Method Summary
  __init__(self, oStack, attrs, parser, **args)
Initializes a Sentences object.
  addSentence(self, sentence)
Appends sentence to the end of the list of sentences.
  regenId(self)
Regenerate the id instance variables.
  writeXMLNestedItems(self, out, indent)
    Inherited from BIXMLWriteable
  writeXML(self, out, indent, **kwArgs)
Outputs the complete XML representation of the given object.
  writeXMLClose(self, out, indent)
Prints the closing tag of the object: </tag>.
  writeXMLOpen(self, out, indent, closing)
Writes opening tag into the XML output.
  XMLAttrs(self)
Computes the string representation of the object's attributes, which are included into the XML tag.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T

Instance Variable Summary
list sentences: List of Sentence objects.

Class Variable Summary
str XMLTag = 'sentences'
    Inherited from BIXMLWriteable
list persistentAttrs: The list of attributes to be included in the XML output.

Method Details

__init__(self, oStack, attrs, parser, **args)
(Constructor)

Initializes a Sentences object. Called by the XML parser which also provides the arguments.
Parameters:
oStack - List of objects representing the current nesting of tags in the XML document. The oStack here will be an empty list, because sentences is the top-level tag.
attrs - The dictionary of attributes of the sentences tag, as provided by the XML parser
Overrides:
BasicClasses.BIObject.__init__

addSentence(self, sentence)

Appends sentence to the end of the list of sentences.
Parameters:
sentence - The sentence to be appended.
           (type=Instance of Sentence, or derived.)

regenId(self)

Regenerate the id instance variables. Only to be used when the corpus data was changed (re-tokenized, etc...). This is not to be used unless you know exactly what you are doing.

Instance Variable Details

sentences

List of Sentence objects.
Type:
list

Class Variable Details

XMLTag

Type:
str
Value:
'sentences'                                                            

Generated by Epydoc 2.0 on Tue Nov 21 15:32:22 2006 http://epydoc.sf.net