GrammarScope  4.0.0
Public Member Functions | List of all members
grammarscope.io.xml.XMLDocumentFactory Class Referenceabstract
Inheritance diagram for grammarscope.io.xml.XMLDocumentFactory:
Inheritance graph
[legend]
Collaboration diagram for grammarscope.io.xml.XMLDocumentFactory:
Collaboration graph
[legend]

Public Member Functions

 XMLDocumentFactory (final URL url)
 
boolean init (final String text)
 
String getText () throws RuntimeException
 
List< WordSegmentgetWords () throws RuntimeException
 
int getSentenceCount () throws RuntimeException
 
List< SentenceSegmentgetSentences () throws RuntimeException
 
List< TokengetTokens (final int sentenceIdx) throws RuntimeException
 
APartsOfSpeech getPoses (final int sentenceIdx) throws RuntimeException
 
AParseTree getParseTree (final int sentenceIdx) throws RuntimeException
 
AGrammaticalStructure getGrammaticalStructure (final int sentenceIdx) throws RuntimeException
 
ARelationDependents getRelationDependents (final int sentenceIdx) throws RuntimeException
 
ATypedDependencies getTypedDependencies (final int sentenceIdx, final TypedDependencyProvider provider, final TypedDependencyMode mode) throws RuntimeException
 
Map< TypedDependencyProvider, Map< TypedDependencyMode, ATypedDependencies > > getTypedDependencies (final int sentenceIdx) throws RuntimeException
 
ASemanticGraph getSemanticGraph (final int sentenceIdx, final TypedDependencyProvider provider, final TypedDependencyMode mode) throws RuntimeException
 
Map< TypedDependencyProvider, Map< TypedDependencyMode, ASemanticGraph > > getSemanticGraphs (final int sentenceIdx) throws RuntimeException
 
ANamedEntities getNamedEntities (final int sentenceIdx) throws RuntimeException
 
Sentiment getSentiment (final int sentenceIdx) throws RuntimeException
 
List< EntailmentgetEntailments (final int sentenceIdx) throws RuntimeException
 
List< TriplegetTriples (final int sentenceIdx) throws RuntimeException
 
ACoreferences getCoreferences () throws RuntimeException
 
AAnalysis getAnalysis (final int sentenceIdx) throws RuntimeException
 
ATextAnalysis getTextAnalysis (final TypedDependencyProvider provider, final TypedDependencyMode mode) throws RuntimeException
 
String[] getReports (final int sentenceIdx, final boolean xMLFlag) throws RuntimeException
 
String getReport (final int sentenceIdx, final boolean xMLFlag) throws RuntimeException
 
String getTextReport (final TypedDependencyProvider provider, final TypedDependencyMode mode, final boolean xMLModeFlag) throws RuntimeException
 
String[] getTextReports (final TypedDependencyProvider provider, final TypedDependencyMode mode, final boolean xMLModeFlag) throws RuntimeException
 
TypedDependencyProvider[] getSupportedProviders ()
 
TypedDependencyMode[] getSupportedModes ()
 
- Public Member Functions inherited from grammarscope.io.xml.XMLDocument
boolean init ()
 

Additional Inherited Members

- Public Attributes inherited from grammarscope.io.xml.XMLDocument
boolean stanfordMode = true
 
- Protected Member Functions inherited from grammarscope.io.xml.XMLDocument
 XMLDocument (final URL url)
 
- Protected Attributes inherited from grammarscope.io.xml.XMLDocument
String ROOT
 
String ROOT_FORMAT
 
String DOCUMENT
 
String TEXT
 
String SENTENCES
 
String SENTENCE
 
String SENTENCE_IDX
 
String SENTENCE_FROM
 
String SENTENCE_TO
 
String SENTENCE_TEXT
 
String SENTENCE_BEGIN
 
String SENTENCE_END
 
String TOKENS
 
String TOKEN
 
String TOKEN_IDX
 
String TOKEN_FROM
 
String TOKEN_TO
 
String TOKEN_BEGIN
 
String TOKEN_END
 
String TOKEN_WORD
 
String TOKEN_LEMMA
 
String TOKEN_POS
 
String TOKEN_NER
 
String TOKEN_NORM_NER
 
String TOKEN_SENTIMENT
 
String TOKEN_SPEAKER
 
String PARSE
 
String PARSE_FORMAT
 
String PARSE_NODE
 
String PARSE_NODE_IDX
 
String PARSE_NODE_VALUE
 
String PARSE_NODE_SCORE
 
String PARSE_NODE_WORD
 
String PARSE_NODE_WORD_IDX
 
String PARSE_NODE_LEMMA
 
String GSTRUCTURE
 
String GSTRUCTURE_FORMAT
 
String GSNODE
 
String GSNODE_IDX
 
String GSNODE_VALUE
 
String GSNODE_SCORE
 
String GSNODE_RELATION
 
String GSNODE_WORD
 
String GSNODE_WORD_IDX
 
String GSNODE_LEMMA
 
String GSNODE_HEAD
 
String GSNODE_ANNOTATION
 
String GSNODE_ANNOTATION_KEY
 
String GSNODE_DEPENDENT
 
String GSNODE_GOVERNOR
 
String TYPEDDEPENDENCIES_SET
 
String TYPEDDEPENDENCIES
 
String TYPEDDEPENDENCIES_PROVIDER
 
String TYPEDDEPENDENCIES_MODE
 
String TYPEDDEPENDENCIES_STYLE
 
String GRAPH_SET
 
String GRAPH
 
String GRAPH_PROVIDER
 
String GRAPH_MODE
 
String GRAPH_DEPENDENCIES
 
String GRAPH_ROOTS
 
String GRAPH_ROOT
 
String GRAPH_ROOT_IDX
 
String DEPENDENCY
 
String DEPENDENCY_TYPE
 
String RELATION
 
String DEPENDENT
 
String DEPENDENT_IDX
 
String GOVERNOR
 
String GOVERNOR_IDX
 
String NAMED_ENTITIES
 
String NAMED_ENTITY
 
String NAMED_ENTITY_FROM
 
String NAMED_ENTITY_TO
 
String NAMED_ENTITY_WORD
 
String NAMED_ENTITY_GENDER
 
String NAMED_ENTITY_NUMBER
 
String NAMED_ENTITY_ANIMACY
 
String SENTIMENT
 
String SENTIMENT_CLASS
 
String SENTIMENT_VALUE
 
String ENTAILMENTS
 
String ENTAILMENT
 
String ENTAILMENT_SCORE
 
String TRIPLES
 
String TRIPLE
 
String TRIPLE_SUBJECT
 
String TRIPLE_RELATION
 
String TRIPLE_OBJECT
 
String COREFERENCES
 
String COREFERENCE
 
String COREFERENCE_MENTION
 
String COREFERENCE_MENTION_FROM
 
String COREFERENCE_MENTION_TO
 
String COREFERENCE_MENTION_REPRESENTATIVE
 
String COREFERENCE_TEXT
 
String COREFERENCE_HEAD
 
String COREFERENCE_SENTENCE
 
String COREFERENCE_START
 
String COREFERENCE_END
 
String text
 
List< List< WordSegment > > segments
 
Map< Integer, Map< Integer, Token > > tokens
 
Map< Integer, AParseTreeparses
 
Map< Integer, AGrammaticalStructuregrammaticalStructures
 
Map< Integer, Map< TypedDependencyProvider, Map< TypedDependencyMode, ATypedDependencies > > > typedDependencies
 
Map< Integer, Map< TypedDependencyProvider, Map< TypedDependencyMode, ASemanticGraph > > > semanticGraphs
 
Map< Integer, APartsOfSpeechposes
 
Map< Integer, ANamedEntitiesnamedEntities
 
Map< Integer, Sentimentsentiments
 
Map< Integer, List< Entailment > > entailments
 
Map< Integer, List< Triple > > triples
 
ACoreferences coreferences
 
Document domDocument
 
final URL url
 

Detailed Description

Document (as read from XML formatted data)

Author
Bernard Bou

Constructor & Destructor Documentation

◆ XMLDocumentFactory()

grammarscope.io.xml.XMLDocumentFactory.XMLDocumentFactory ( final URL  url)

Constructor

Parameters
urlXML document URL

Member Function Documentation

◆ getAnalysis()

AAnalysis grammarscope.io.xml.XMLDocumentFactory.getAnalysis ( final int  sentenceIdx) throws RuntimeException

Get (sentence) analysis artifact

Parameters
sentenceIdxsentence index
Returns
analysis if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getCoreferences()

ACoreferences grammarscope.io.xml.XMLDocumentFactory.getCoreferences ( ) throws RuntimeException

Get coreferences artifact

Returns
coreferences artifact if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getEntailments()

List<Entailment> grammarscope.io.xml.XMLDocumentFactory.getEntailments ( final int  sentenceIdx) throws RuntimeException

Get entailments

Parameters
sentenceIdxsentence index
Returns
entailments if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getGrammaticalStructure()

AGrammaticalStructure grammarscope.io.xml.XMLDocumentFactory.getGrammaticalStructure ( final int  sentenceIdx) throws RuntimeException

Get grammatical structure artifact

Parameters
sentenceIdxsentence index
Returns
grammatical structure artifact if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getNamedEntities()

ANamedEntities grammarscope.io.xml.XMLDocumentFactory.getNamedEntities ( final int  sentenceIdx) throws RuntimeException

Get named entities artifact

Parameters
sentenceIdxsentence index
Returns
named entities artifact if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getParseTree()

AParseTree grammarscope.io.xml.XMLDocumentFactory.getParseTree ( final int  sentenceIdx) throws RuntimeException

Get parse artifact

Parameters
sentenceIdxsentence index
Returns
parse tree artifact if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getPoses()

APartsOfSpeech grammarscope.io.xml.XMLDocumentFactory.getPoses ( final int  sentenceIdx) throws RuntimeException

Get parts-of-speech artifact

Parameters
sentenceIdxsentence index
Returns
parts-of-speech artifact if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getRelationDependents()

ARelationDependents grammarscope.io.xml.XMLDocumentFactory.getRelationDependents ( final int  sentenceIdx) throws RuntimeException

Get relation dependents artifact

Parameters
sentenceIdxsentence index
Returns
relation dependents artifact if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getReport()

String grammarscope.io.xml.XMLDocumentFactory.getReport ( final int  sentenceIdx,
final boolean  xmlFlag 
) throws RuntimeException

Get (sentence) analysis string

Parameters
sentenceIdxsentence index
xmlFlagXML format requested
Returns
string

Implements grammarscope.iface.IDocumentFactoryService.

◆ getReports()

String [] grammarscope.io.xml.XMLDocumentFactory.getReports ( final int  sentenceIdx,
final boolean  xmlFlag 
) throws RuntimeException

Get (sentence) analysis strings

Parameters
sentenceIdxsentence index
xmlFlagXML format requested
Returns
array of strings [0] text, [1] parse tree, [2] grammatical structure, [3] typed dependencies, [4] semantic graph if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getSemanticGraph()

ASemanticGraph grammarscope.io.xml.XMLDocumentFactory.getSemanticGraph ( final int  sentenceIdx,
final TypedDependencyProvider  provider,
final TypedDependencyMode  mode 
) throws RuntimeException

Get semantic graph artifact

Parameters
sentenceIdxsentence index
providertyped dependency provider
modetyped dependency mode
Returns
semantic graph artifact if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getSemanticGraphs()

Map<TypedDependencyProvider, Map<TypedDependencyMode, ASemanticGraph> > grammarscope.io.xml.XMLDocumentFactory.getSemanticGraphs ( final int  sentenceIdx) throws RuntimeException

Get semantic graph artifacts

Parameters
sentenceIdxsentence index
Returns
typed dependency mode-indexed semantic graph artifacts if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getSentenceCount()

int grammarscope.io.xml.XMLDocumentFactory.getSentenceCount ( ) throws RuntimeException

Get sentence count

Returns
sentence count

Implements grammarscope.iface.IDocumentFactoryService.

◆ getSentences()

List<SentenceSegment> grammarscope.io.xml.XMLDocumentFactory.getSentences ( ) throws RuntimeException

Get sentences

Returns
list of sentence segments

Implements grammarscope.iface.IDocumentFactoryService.

◆ getSentiment()

Sentiment grammarscope.io.xml.XMLDocumentFactory.getSentiment ( final int  sentenceIdx) throws RuntimeException

Get sentiment

Parameters
sentenceIdxsentence index
Returns
sentiment if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getSupportedModes()

TypedDependencyMode [] grammarscope.io.xml.XMLDocumentFactory.getSupportedModes ( )

Get supported typed dependency modes

Returns
array of supported typed dependency modes

Implements grammarscope.iface.IDocumentFactoryService.

◆ getSupportedProviders()

TypedDependencyProvider [] grammarscope.io.xml.XMLDocumentFactory.getSupportedProviders ( )

Get supported typed dependency providers

Returns
array of supported typed dependency providers

Implements grammarscope.iface.IDocumentFactoryService.

◆ getText()

String grammarscope.io.xml.XMLDocumentFactory.getText ( ) throws RuntimeException

Get text

Returns
(original or reconstructed) text

Implements grammarscope.iface.IDocumentFactoryService.

◆ getTextAnalysis()

ATextAnalysis grammarscope.io.xml.XMLDocumentFactory.getTextAnalysis ( final TypedDependencyProvider  provider,
final TypedDependencyMode  mode 
) throws RuntimeException

Get text analysis

Parameters
providerprovider
modemode
Returns
text analysis if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getTextReport()

String grammarscope.io.xml.XMLDocumentFactory.getTextReport ( final TypedDependencyProvider  provider,
final TypedDependencyMode  mode,
final boolean  xMLModeFlag 
) throws RuntimeException

Get text report

Parameters
modetyped dependency mode
xMLModeFlagxml form
Returns
report
Exceptions
RuntimeExceptionexception

Implements grammarscope.iface.IDocumentFactoryService.

◆ getTextReports()

String [] grammarscope.io.xml.XMLDocumentFactory.getTextReports ( final TypedDependencyProvider  provider,
final TypedDependencyMode  mode,
final boolean  xMLModeFlag 
) throws RuntimeException

Get text reports

Parameters
modetyped dependency mode
xMLModeFlagxml form
Returns
reports
Exceptions
RuntimeExceptionexception

Implements grammarscope.iface.IDocumentFactoryService.

◆ getTokens()

List<Token> grammarscope.io.xml.XMLDocumentFactory.getTokens ( final int  sentenceIdx) throws RuntimeException

Get tokens

Parameters
sentenceIdxsentence index
Returns
tokens
Exceptions
RuntimeExceptionruntime exception

Implements grammarscope.iface.IDocumentFactoryService.

◆ getTriples()

List<Triple> grammarscope.io.xml.XMLDocumentFactory.getTriples ( final int  sentenceIdx) throws RuntimeException

Get triples

Parameters
sentenceIdxsentence index
Returns
triples if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getTypedDependencies() [1/2]

Map<TypedDependencyProvider, Map<TypedDependencyMode, ATypedDependencies> > grammarscope.io.xml.XMLDocumentFactory.getTypedDependencies ( final int  sentenceIdx) throws RuntimeException

Get typed dependencies artifact

Parameters
sentenceIdxsentence index
Returns
typed dependency mode-indexed typed dependencies artifacts if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getTypedDependencies() [2/2]

ATypedDependencies grammarscope.io.xml.XMLDocumentFactory.getTypedDependencies ( final int  sentenceIdx,
final TypedDependencyProvider  provider,
final TypedDependencyMode  mode 
) throws RuntimeException

Get typed dependencies artifact

Parameters
sentenceIdxsentence index
providertyped dependency provider
modetyped dependency mode
Returns
typed dependencies artifact if successful

Implements grammarscope.iface.IDocumentFactoryService.

◆ getWords()

List<WordSegment> grammarscope.io.xml.XMLDocumentFactory.getWords ( ) throws RuntimeException

Get words

Returns
list of word segments

Implements grammarscope.iface.IDocumentFactoryService.

◆ init()

boolean grammarscope.io.xml.XMLDocumentFactory.init ( final String  text)

Init processing

Parameters
textinput text
Returns
true if successful

Implements grammarscope.iface.IDocumentFactory.


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