GrammarScope  4.0.0
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
grammarscope.spo.SPOAnalyzer< T extends ILink > Class Template Referenceabstract
Inheritance diagram for grammarscope.spo.SPOAnalyzer< T extends ILink >:
Inheritance graph
[legend]
Collaboration diagram for grammarscope.spo.SPOAnalyzer< T extends ILink >:
Collaboration graph
[legend]

Public Member Functions

 SPOAnalyzer ()
 
Graph< GraphNode, GraphEdgeanalyze (final Document document, final TypedDependencyProvider provider, final TypedDependencyMode mode)
 

Protected Member Functions

abstract Collection< TokengetRoots (final Document document, final int sentenceIdx, final TypedDependencyProvider provider, final TypedDependencyMode mode)
 
abstract Collection< T > getEdges (final Document document, final int sentenceIdx, final TypedDependencyProvider provider, final TypedDependencyMode mode)
 
findOneOf (final Collection< T > edges0, final String[] acceptableIds, final Token governor)
 
List< T > findAllOf (final Collection< T > edges0, final String[] acceptableIds, final Token governor)
 

Private Member Functions

void analyzePredicate (final int sentenceIdx, final Token predicate, final Collection< T > edges, final List< Link > links)
 
void analyzeTerm (final int sentenceIdx, final PT pT, final Collection< T > edges, final List< Link > links)
 
PS makePS (final int sentenceIdx, final Collection< T > edges, final Token predicate)
 
PO makePO (final int sentenceIdx, final Collection< T > edges, final Token predicate)
 
List< PPmakePPs (final int sentenceIdx, final Collection< T > edges, final Token predicate)
 
List< TPmakeTPs (final int sentenceIdx, final Collection< T > edges, final Token... terms)
 
Collection< T > filter (final Collection< T > edges0)
 
boolean accept (final T edge)
 

Static Private Member Functions

static Map< Instance, MentionmakeMap (final Document document)
 

Private Attributes

final Set< TokenvisitedNotes
 

Detailed Description

Semantic pred-subject-object analyzer

Author
Bernard Bou

Constructor & Destructor Documentation

◆ SPOAnalyzer()

Constructor

Member Function Documentation

◆ accept()

boolean grammarscope.spo.SPOAnalyzer< T extends ILink >.accept ( final T  edge)
private

Accept edge relevant to SPO

Parameters
edgetested edge
Returns
whether this edge is relevant to SPO

◆ analyze()

Graph<GraphNode, GraphEdge> grammarscope.spo.SPOAnalyzer< T extends ILink >.analyze ( final Document  document,
final TypedDependencyProvider  provider,
final TypedDependencyMode  mode 
)

◆ analyzePredicate()

void grammarscope.spo.SPOAnalyzer< T extends ILink >.analyzePredicate ( final int  sentenceIdx,
final Token  predicate,
final Collection< T >  edges,
final List< Link links 
)
private

Analyze predicate

Parameters
sentenceIdxsentence index
predicatepredicate
edgessource edges
linksresult links

◆ analyzeTerm()

void grammarscope.spo.SPOAnalyzer< T extends ILink >.analyzeTerm ( final int  sentenceIdx,
final PT  pT,
final Collection< T >  edges,
final List< Link links 
)
private
Parameters
sentenceIdxsentence index
pTpt
edgessource edges
linksresult links

◆ filter()

Collection<T> grammarscope.spo.SPOAnalyzer< T extends ILink >.filter ( final Collection< T >  edges0)
private

Filter out irrelevant edges

Parameters
edges0source edges
Returns
relevant edges

◆ findAllOf()

List<T> grammarscope.spo.SPOAnalyzer< T extends ILink >.findAllOf ( final Collection< T >  edges0,
final String[]  acceptableIds,
final Token  governor 
)
protected

Find all edges with acceptable id and specific governor

Parameters
edges0edges
acceptableIdsacceptable id
governorgovernor
Returns
list of edges with acceptable id and specific governor

◆ findOneOf()

T grammarscope.spo.SPOAnalyzer< T extends ILink >.findOneOf ( final Collection< T >  edges0,
final String[]  acceptableIds,
final Token  governor 
)
protected

Find first edge with acceptable id and specific governor

Parameters
edges0edges
acceptableIdsacceptable id
governorgovernor
Returns
first edge with acceptable id and specific governor

◆ getEdges()

abstract Collection<T> grammarscope.spo.SPOAnalyzer< T extends ILink >.getEdges ( final Document  document,
final int  sentenceIdx,
final TypedDependencyProvider  provider,
final TypedDependencyMode  mode 
)
abstractprotected

◆ getRoots()

abstract Collection<Token> grammarscope.spo.SPOAnalyzer< T extends ILink >.getRoots ( final Document  document,
final int  sentenceIdx,
final TypedDependencyProvider  provider,
final TypedDependencyMode  mode 
)
abstractprotected

◆ makeMap()

static Map<Instance, Mention> grammarscope.spo.SPOAnalyzer< T extends ILink >.makeMap ( final Document  document)
staticprivate

Make map

Parameters
documentdocument
Returns
instance-index mentions

◆ makePO()

PO grammarscope.spo.SPOAnalyzer< T extends ILink >.makePO ( final int  sentenceIdx,
final Collection< T >  edges,
final Token  predicate 
)
private

Make predicate-object

Parameters
sentenceIdxsentence index
edgessource edges
predicatepredicate
Returns
predicate-object link

◆ makePPs()

List<PP> grammarscope.spo.SPOAnalyzer< T extends ILink >.makePPs ( final int  sentenceIdx,
final Collection< T >  edges,
final Token  predicate 
)
private

Make predicate-predicate (ex:clausal complement)

Parameters
sentenceIdxsentence index
edgessource edges
predicatepredicate
Returns
predicate-predicate link

◆ makePS()

PS grammarscope.spo.SPOAnalyzer< T extends ILink >.makePS ( final int  sentenceIdx,
final Collection< T >  edges,
final Token  predicate 
)
private

Make predicate-subject

Parameters
sentenceIdxsentence index
edgessource edges
predicatepredicate
Returns
predicate-subject

◆ makeTPs()

List<TP> grammarscope.spo.SPOAnalyzer< T extends ILink >.makeTPs ( final int  sentenceIdx,
final Collection< T >  edges,
final Token...  terms 
)
private

Make term predicate (ex:relative clause)

Parameters
sentenceIdxsentence index
edgessource edges
termsterms
Returns
list of term-predicate

Member Data Documentation

◆ visitedNotes

final Set<Token> grammarscope.spo.SPOAnalyzer< T extends ILink >.visitedNotes
private

To avoid visiting cycling


The documentation for this class was generated from the following file: