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

Class BioInfer

    object --+    
             |    
      BIObject --+
                 |
    object --+   |
             |   |
BIXMLWriteable --+
                 |
                BioInfer


The top-level class in the hierarchy of objects which represents the corpus. It holds the Sentences object as well as the ontologies. A single instance of this class is created and maintained by the XML parser. It corresponds to the top-level item in the XML file.
Method Summary
  __init__(self, parser, attrs, **args)
  addOntology(self, ontology)
Insert an ontology into the ontologies dictionary.
  isValid(self)
Validity check for the parsed corpus.
  regenId(self)
Regenerate the id instance variables.
  writeXMLNestedItems(self, out, indent, includeOntologies)
    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
Dictionary ontologies: A dictionary which stores the ontologies.
Sentences sentences: An instance of Sentences, holding the sentences of the corpus.

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

Method Details

addOntology(self, ontology)

Insert an ontology into the ontologies dictionary. The key is ontology.type. If an ontology already exists in the dictionary under the given key, it gets replaced by the new ontology.
Parameters:
ontology - The OntologyClasses.Ontology to be stored.

isValid(self)

Validity check for the parsed corpus. This returns False is any of the required corpus components is missing.

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

ontologies

A dictionary which stores the ontologies. The key correponds to the ontology type.
Type:
Dictionary

sentences

An instance of Sentences, holding the sentences of the corpus.
Type:
Sentences

Class Variable Details

XMLTag

Type:
str
Value:
'bioinfer'                                                             

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