Module extract
[show private | hide private]
[frames | no frames]

Module extract

Function Summary
  printBasicDependencies(sentence)
Prints the dependencies of the "basic" (unexpanded) linkage using printLinkageDependencies.
  printEntities(sentence)
Prints the entities of the given sentence in the format "TYPE(ID, [CHAR_OFFSETS], 'TEXT')", where TYPE is the type of the entity (found in the entity type ontology), ID is the unique identifier of the entity, CHAR_OFFSETS is a comma-separated list of "FROM_OFF-TO_OFF" character offsets specifying where in the untokenized sentence text the entity is found, and TEXT is the text of the token.
  printLinkageDependencies(sentence, linkage)
Prints the dependencies of the given linkage for the given sentence in "FROM-TO[TYPE]" format, where FROM and TO are token offsets and TYPE is the type of the dependency.
  printParallelDependencies(sentence)
Prints the dependencies of the typed linkage with NP macro-dependencies expanded in parallel using printLinkageDependencies.
  printRelationships(sentence)
Prints the relationships of the given sentence in the format "TYPE([CHAR_OFFSETS], ARGS)" where TYPE is the type of the relationship (found in the relationship type ontology), CHAR_OFFSETS is a comma-separated list of "FROM_OFF-TO_OFF" character offsets specifying the text binding of the relationship in the untokenized sentence text, and ARGS is a comma-separated list of the arguments of the relationship, where entities are represented by their unique identifiers and relationship arguments by their strings as defined (recursively) above.
  printSerialDependencies(sentence)
Prints the dependencies of the typed linkage with NP macro-dependencies expanded serially using printLinkageDependencies.
  printText(sentence)
Prints the original, untokenized text of the given sentence.
  printTokenizedText(sentence)
Prints the tokenized text of the given sentence, with tokens separated by whitespace.
  printTokenOffsets(sentence)
Prints the tokens of the given sentence in the format "token(TOKEN_IDX, [FROM_OFFSET-TO_OFFSET], 'TOKEN_TEXT') where FROM_OFFSET and TO_OFFSET are character offsets into the original sentence text.
  relationshipToString(r)
Returns a string representing the given relationship in the format required by printRelationships.

Variable Summary
list actions = [('TXT', <function printText at 0xb7bd4924>, '...

Function Details

printBasicDependencies(sentence)

Prints the dependencies of the "basic" (unexpanded) linkage using printLinkageDependencies.
Parameters:
sentence - The sentence from which to extract the information to output.
           (type=BasicClasses.Sentence)

printEntities(sentence)

Prints the entities of the given sentence in the format "TYPE(ID, [CHAR_OFFSETS], 'TEXT')", where TYPE is the type of the entity (found in the entity type ontology), ID is the unique identifier of the entity, CHAR_OFFSETS is a comma-separated list of "FROM_OFF-TO_OFF" character offsets specifying where in the untokenized sentence text the entity is found, and TEXT is the text of the token.
Parameters:
sentence - The sentence from which to extract the information to output.
           (type=BasicClasses.Sentence)

printLinkageDependencies(sentence, linkage)

Prints the dependencies of the given linkage for the given sentence in "FROM-TO[TYPE]" format, where FROM and TO are token offsets and TYPE is the type of the dependency. If the type is None, the bracketed part is not output. Additionally, NP macro-dependencies are typed "macro". Output dependencies are separated by space.
Parameters:
sentence - The sentence from which to extract the information to output.
           (type=BasicClasses.Sentence)
linkage - a string identifying the type of linkage to output.
           (type=String)

printParallelDependencies(sentence)

Prints the dependencies of the typed linkage with NP macro-dependencies expanded in parallel using printLinkageDependencies.
Parameters:
sentence - The sentence from which to extract the information to output.
           (type=BasicClasses.Sentence)

printRelationships(sentence)

Prints the relationships of the given sentence in the format "TYPE([CHAR_OFFSETS], ARGS)" where TYPE is the type of the relationship (found in the relationship type ontology), CHAR_OFFSETS is a comma-separated list of "FROM_OFF-TO_OFF" character offsets specifying the text binding of the relationship in the untokenized sentence text, and ARGS is a comma-separated list of the arguments of the relationship, where entities are represented by their unique identifiers and relationship arguments by their strings as defined (recursively) above.
Parameters:
sentence - The sentence from which to extract the information to output.
           (type=BasicClasses.Sentence)

printSerialDependencies(sentence)

Prints the dependencies of the typed linkage with NP macro-dependencies expanded serially using printLinkageDependencies.
Parameters:
sentence - The sentence from which to extract the information to output.
           (type=BasicClasses.Sentence)

printText(sentence)

Prints the original, untokenized text of the given sentence.
Parameters:
sentence - The sentence from which to extract the information to output.
           (type=BasicClasses.Sentence)

printTokenizedText(sentence)

Prints the tokenized text of the given sentence, with tokens separated by whitespace.
Parameters:
sentence - The sentence from which to extract the information to output.
           (type=BasicClasses.Sentence)

printTokenOffsets(sentence)

Prints the tokens of the given sentence in the format "token(TOKEN_IDX, [FROM_OFFSET-TO_OFFSET], 'TOKEN_TEXT') where FROM_OFFSET and TO_OFFSET are character offsets into the original sentence text.
Parameters:
sentence - The sentence from which to extract the information to output.
           (type=BasicClasses.Sentence)

relationshipToString(r)

Returns a string representing the given relationship in the format required by printRelationships.
Parameters:
r - the relationship to convert to a string.
           (type=BasicClasses.Formula)

Variable Details

actions

Type:
list
Value:
[('TXT',
  <function printText at 0xb7bd4924>,
  '-t',
  '--text',
  'Extract the original, untokenized text of the sentence.'),
 ('TOK',
  <function printTokenizedText at 0xb7bd49cc>,
  '-k',
...                                                                    

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