Package TEES :: Package Utils :: Package InteractionXML :: Module ParseGraph :: Class ParseGraph
[hide private]

Class ParseGraph

source code

A ParseGraph-object consists of tokens and dependencies. A dependency connects two tokens with two edges (token->dependency->token, where -> = edge).

Instance Methods [hide private]
 
__init__(self, tokenElements, dependencyElements, mergeDependencies=False) source code
 
buildParseGraph(self, tokenElements, dependencyElements, mergeDependencies=False)
Returns dictionaries containing tokens and dependencies of the graph generated from ElementTree-elements.
source code
 
markNamedEntities(self, entityElements)
Marks tokens belonging to named entities
source code
 
getNamedEntityTokenIds(self, namedEntityIds)
Returns the ids of all tokens in specified named entities
source code
 
getTokenIdsByText(self, texts, lookInsideNamedEntities=False)
Returns the ids of all tokens whose text attribute can be found in the list texts.
source code
 
stemTokens(self) source code
 
buildNXGraph(self)
Initializes the graph structure used by NetworkX.
source code
 
buildShortestPathNX(self, startTokenId, endTokenId, directed=False)
Build shortest path using NetworkX
source code
Method Details [hide private]

getTokenIdsByText(self, texts, lookInsideNamedEntities=False)

source code 

Returns the ids of all tokens whose text attribute can be found in the list texts. Can be used f.e. detecting interaction words.

buildNXGraph(self)

source code 

Initializes the graph structure used by NetworkX. Called automatically when needed.