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

Class Entity

    object --+    
             |    
      BIObject --+
                 |
    object --+   |
             |   |
BIXMLWriteable --+
                 |
                Entity


The representation of Entity as a list of subtokens.
Method Summary
  __init__(self, oStack, parser, attrs, **args)
  addNestedEntity(self, entity)
Add an entity to the list of entities nested within the current entity
  addSubToken(self, subToken)
Add a subToken to the entity.
  computeXMLArgs(self)
  getCharOffsets(self)
Returns the character offsets to the original sentence text of the SubTokens of which this entity consists.
  getText(self, getType)
Returns the text of the entity.
  isFormulaEntity(self)
Test whether the entity is being used as a text binding of an entity formula node (L<EntityNode>).
  isFormulaRelationship(self)
Test whether the entity is being used as a text binding of a relationship formula node (L<RelNode>).
  registerFormulaNode(self, node)
Append a formula node to the list of formula nodes that use this entity as a text binding
  writeXMLNestedEntities(self, out, indent)
  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 formulaNodesUsingMe: The list of formula nodes which refer to this entity, using it as their text binding: both Relationships (RelNode) and Entities (EntityNode).
string id: The unique id of the entity in the corpus.
list nestedEntities: The entities which are directly nested in the current entity.
Sentence sentence: The sentence this entity belongs to.
list subTokens: A list of subtokens which constitute this entity.
EntityType type: The entity type of this entity.

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

Method Details

addNestedEntity(self, entity)

Add an entity to the list of entities nested within the current entity
Parameters:
entity - The entity to be added
           (type=Entity)

addSubToken(self, subToken)

Add a subToken to the entity.
Parameters:
subToken - The subToken to be added.
           (type=SubToken)

getCharOffsets(self)

Returns the character offsets to the original sentence text of the SubTokens of which this entity consists.
Returns:
List of (from,to) tuples, where from and to are integer offsets.

getText(self, getType=False)

Returns the text of the entity.

isFormulaEntity(self)

Test whether the entity is being used as a text binding of an entity formula node (L<EntityNode>). In the corpus, never isFormulaRelationship and isFormulaEntity return True at the same time.

isFormulaRelationship(self)

Test whether the entity is being used as a text binding of a relationship formula node (L<RelNode>). In the corpus, never isFormulaRelationship and isFormulaEntity return True at the same time.

registerFormulaNode(self, node)

Append a formula node to the list of formula nodes that use this entity as a text binding
Parameters:
node - The node to be added to the list.
           (type=FormulaNode)

Instance Variable Details

formulaNodesUsingMe

The list of formula nodes which refer to this entity, using it as their text binding: both Relationships (RelNode) and Entities (EntityNode). While the code is written in a general way, in the actual corpus, the same entity is never used both as a relationship and entity text binding.
Type:
list

id

The unique id of the entity in the corpus.
Type:
string

nestedEntities

The entities which are directly nested in the current entity.
Type:
list

sentence

The sentence this entity belongs to.
Type:
Sentence

subTokens

A list of subtokens which constitute this entity.
Type:
list

type

The entity type of this entity. The type is a node in an ontology.
Type:
EntityType

Class Variable Details

persistentAttrs

The list of attributes to be included in the XML output. By default an empty list, that is, no attributes are included by default.
Type:
list
Value:
['id', 'annotation', 'other']                                          

XMLTag

Type:
str
Value:
'entity'                                                               

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