| Trees | Index | Help |
|---|
| Module BasicClasses :: Class Sentence |
|
object --+
|
BIObject --+
|
object --+ |
| |
BIXMLWriteable --+
|
Sentence
Sentence holds all annotation for a single sentence:
entities, formulas, and linkages.
| Method Summary | |
|---|---|
Initializes a Sentence object. | |
Includes the entity into the dictionary entities, key
being entity.id. | |
Appends a token at the end of the list of tokens
tokens. | |
Returns the sequence number of the next subtoken to be included into the sequence. | |
| string |
A space-delimited string of all tokens in the sentence. |
Returns the sequence number of the next token to be included into the sequence. | |
Regenerate the id instance variables. | |
writeXMLNestedItems(self,
out,
indent)
| |
| Inherited from BIXMLWriteable | |
Outputs the complete XML representation of the given object. | |
Prints the closing tag of the object: </tag>. | |
Writes opening tag into the XML output. | |
Computes the string representation of the object's attributes, which are included into the XML tag. | |
| Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
| Inherited from type | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
| Instance Variable Summary | |
|---|---|
| dictionary | entitiesById: Dictionary of Entities, where the entity id serves as
key. |
| list | formulas: List of Formulas. |
| String | id: The unique id of the sentence. |
| dictionary | linkages: Dictionary of Linkages, where the linkage type serves as
key. |
| String | origText: The original, untokenized text of the sentence |
sentences |
sentences: The sentences instance to which this sentence
belongs. |
| list | tokens: List of Tokens. |
| Class Variable Summary | |
|---|---|
| List of strings | persistentAttrs: The attributes written in the XML file for each sentence. |
str |
XMLTag = 'sentence'
|
| Method Details |
|---|
__init__(self,
oStack,
attrs,
**args)
Initializes a |
addEntity(self, entity)Includes the entity into the dictionaryentities, key
being entity.id.
|
addToken(self, token)Appends atoken at the end of the list of tokens
tokens.
|
getSubTokenSequence(self)Returns the sequence number of the next subtoken to be included into the sequence. A special method only used during XML parsing. |
getText(self)A space-delimited string of all tokens in the sentence.
|
getTokenSequence(self)Returns the sequence number of the next token to be included into the sequence. A special method only used during XML parsing. |
regenId(self)Regenerate theid 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 |
|---|
entitiesByIdDictionary ofEntities, where the entity id serves as
key.
|
formulasList ofFormulas. They are ordered in the same
order as they appear in the XML file.
|
idThe unique id of the sentence. It is also used as part of the ids of all objects that belong to this sentence.
|
linkagesDictionary ofLinkages, where the linkage type serves as
key.
|
origTextThe original, untokenized text of the sentence
|
sentencesThesentences instance to which this sentence
belongs.
|
tokensList ofTokens. The tokens are/must be ordered in
the same order as they appear in the XML file (and that order preserves
the sentence order).
|
| Class Variable Details |
|---|
persistentAttrsThe attributes written in the XML file for each sentence.
|
XMLTag
|
| Trees | Index | Help |
|---|
| Generated by Epydoc 2.0 on Tue Nov 21 15:32:22 2006 | http://epydoc.sf.net |