GrammarScope  4.0.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
grammarscope.glue.parser.DocumentFactory Class Reference
Inheritance diagram for grammarscope.glue.parser.DocumentFactory:
Inheritance graph
[legend]
Collaboration diagram for grammarscope.glue.parser.DocumentFactory:
Collaboration graph
[legend]

Public Member Functions

 DocumentFactory (final Language language)
 
boolean init (final String text)
 
Segmentation getSegmentation () throws RuntimeException
 
List< TokengetTokens (final int sentenceIdx) throws RuntimeException
 
TypedDependencyProvider[] getSupportedProviders () throws RuntimeException
 
TypedDependencyMode[] getSupportedModes () throws RuntimeException
 
- Public Member Functions inherited from grammarscope.glue.AbstractDocumentFactory
 AbstractDocumentFactory (final Language language)
 
String getText () throws RuntimeException
 
List< SentenceSegmentgetSentences () throws RuntimeException
 
int getSentenceCount () throws RuntimeException
 
List< WordSegmentgetWords () throws RuntimeException
 
AParseTree getParseTree (final int sentenceIdx) throws RuntimeException
 
APartsOfSpeech getPoses (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)
 
List< TriplegetTriples (final int sentenceIdx)
 
ACoreferences getCoreferences () throws RuntimeException
 
ATextAnalysis getTextAnalysis (final TypedDependencyProvider provider, final TypedDependencyMode mode) throws RuntimeException
 
AAnalysis getAnalysis (final int sentenceIdx) 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
 

Static Public Member Functions

static void set (final IStanfordServer server)
 
static void set (final ISegmenter server)
 
static void set (final IParser server)
 
static void set (final IGrammaticalStructureAnalyzer server)
 
static void set (final IDependencyParser server)
 
static void set (final ITypedDependenciesAnalyzer server)
 
static void set (final ISemanticGraphAnalyzer server)
 
static void set (final IMorphology server)
 

Protected Member Functions

Tree getStanfordParseTree (final int sentenceIdx) throws RuntimeException
 
GrammaticalStructure getStanfordGrammaticalStructure (final int sentenceIdx) throws RuntimeException
 
GrammaticalStructure getStanfordGrammaticalStructure2 (final int sentenceIdx) throws RuntimeException
 
Collection< TypedDependency > getStanfordTypedDependencies (final int sentenceIdx, final TypedDependencyMode mode) throws RuntimeException
 
Collection< TypedDependency > getStanfordTypedDependencies2 (final int sentenceIdx, final TypedDependencyMode mode) throws RuntimeException
 
SemanticGraph getStanfordSemanticGraph (final int sentenceIdx, final TypedDependencyMode mode) throws RuntimeException
 
SemanticGraph getStanfordSemanticGraph2 (final int sentenceIdx, final TypedDependencyMode mode) throws RuntimeException
 
List< NamedEntitygetStanfordNamedEntities (final int sentenceIdx) throws RuntimeException
 
Sentiment getStanfordSentiment (final int sentenceIdx) throws RuntimeException
 
List< EntailmentgetStanfordEntailments (final int sentenceIdx) throws RuntimeException
 
List< TriplegetStanfordTriples (final int sentenceIdx) throws RuntimeException
 
Coreferences getStanfordCoreferences () throws RuntimeException
 

Protected Attributes

final Cache< GrammaticalStructure > grammaticalStructures2
 
- Protected Attributes inherited from grammarscope.glue.AbstractDocumentFactory
final Language language
 
String text
 
final RelationDependentsDirectFactory relationDependentsDirectFactory
 
final Cache< List< Token > > tokens
 
final Cache< Tree > parseTrees
 
final Cache< GrammaticalStructure > grammaticalStructures
 
final Map< TypedDependencyMode, Cache< Collection< TypedDependency > > > typedDependencies
 
final Map< TypedDependencyMode, Cache< Collection< TypedDependency > > > typedDependencies2
 

Private Member Functions

List< List< CoreLabel > > getSentenceWords ()
 

Private Attributes

List< List< CoreLabel > > sentenceCoreLabels
 

Static Private Attributes

static ISegmenter segmenter
 
static IParser parser
 
static IGrammaticalStructureAnalyzer grammaticalStructureAnalyzer
 
static IDependencyParser dependencyParser
 
static ITypedDependenciesAnalyzer typedDependencyAnalyzer
 
static ISemanticGraphAnalyzer semanticGraphAnalyzer
 
static IMorphology morphology
 
static final TypedDependencyProvider[] typedDependencyProviders = TypedDependencyProvider.values()
 
static final TypedDependencyMode[] typedDependencyModes = TypedDependencyMode.values()
 

Additional Inherited Members

- Static Public Attributes inherited from grammarscope.glue.AbstractDocumentFactory
static final XMLPrinter xMLPrinter = stanfordMode ? new XMLPrinterStanford() : new XMLPrinterGrammarScope()
 

Detailed Description

Document factory implementation as Stanford Parser client

Author
Bernard Bou

Constructor & Destructor Documentation

◆ DocumentFactory()

grammarscope.glue.parser.DocumentFactory.DocumentFactory ( final Language  language)

Constructor

Parameters
languagelanguage

Member Function Documentation

◆ getSegmentation()

Segmentation grammarscope.glue.parser.DocumentFactory.getSegmentation ( ) throws RuntimeException

Get segmentation

Returns
segmentation
Exceptions
RuntimeExceptionexception

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ getSentenceWords()

List<List<CoreLabel> > grammarscope.glue.parser.DocumentFactory.getSentenceWords ( )
private

Cached on-demand access

Returns
sentence-indexed list of words

◆ getStanfordCoreferences()

Coreferences grammarscope.glue.parser.DocumentFactory.getStanfordCoreferences ( ) throws RuntimeException
protected

Get coreferences

Returns
coreference data if successful

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ getStanfordEntailments()

List<Entailment> grammarscope.glue.parser.DocumentFactory.getStanfordEntailments ( final int  sentenceIdx) throws RuntimeException
protected

Get entailments

Parameters
sentenceIdxsentence index
Returns
entailments

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ getStanfordGrammaticalStructure()

GrammaticalStructure grammarscope.glue.parser.DocumentFactory.getStanfordGrammaticalStructure ( final int  sentenceIdx) throws RuntimeException
protected

Get grammatical structure

Parameters
sentenceIdxsentence
Returns
grammatical structure if successful

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ getStanfordGrammaticalStructure2()

GrammaticalStructure grammarscope.glue.parser.DocumentFactory.getStanfordGrammaticalStructure2 ( final int  sentenceIdx) throws RuntimeException
protected

◆ getStanfordNamedEntities()

List<NamedEntity> grammarscope.glue.parser.DocumentFactory.getStanfordNamedEntities ( final int  sentenceIdx) throws RuntimeException
protected

Get named entities

Parameters
sentenceIdxsentence index
Returns
list of named entities
Exceptions
RuntimeExceptionexception

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ getStanfordParseTree()

Tree grammarscope.glue.parser.DocumentFactory.getStanfordParseTree ( final int  sentenceIdx) throws RuntimeException
protected

Get parse tree

Parameters
sentenceIdxsentence index
Returns
parse tree if successful
Exceptions
RuntimeExceptionexception

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ getStanfordSemanticGraph()

SemanticGraph grammarscope.glue.parser.DocumentFactory.getStanfordSemanticGraph ( final int  sentenceIdx,
final TypedDependencyMode  mode 
) throws RuntimeException
protected

Get semantic graph

Parameters
sentenceIdxsentence
modetyped dependency mode
Returns
semantic graph if successful

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ getStanfordSemanticGraph2()

SemanticGraph grammarscope.glue.parser.DocumentFactory.getStanfordSemanticGraph2 ( final int  sentenceIdx,
final TypedDependencyMode  mode 
) throws RuntimeException
protected

Get semantic graph (workflow 2)

Parameters
sentenceIdxsentence
modetyped dependency mode
Returns
semantic graph if successful

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ getStanfordSentiment()

Sentiment grammarscope.glue.parser.DocumentFactory.getStanfordSentiment ( final int  sentenceIdx) throws RuntimeException
protected

Get sentiment

Parameters
sentenceIdxsentence index
Returns
sentiment

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ getStanfordTriples()

List<Triple> grammarscope.glue.parser.DocumentFactory.getStanfordTriples ( final int  sentenceIdx) throws RuntimeException
protected

Get triples

Parameters
sentenceIdxsentence index
Returns
triples

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ getStanfordTypedDependencies()

Collection<TypedDependency> grammarscope.glue.parser.DocumentFactory.getStanfordTypedDependencies ( final int  sentenceIdx,
final TypedDependencyMode  mode 
) throws RuntimeException
protected

Get typed dependencies

Parameters
sentenceIdxsentence
modetyped dependency mode
Returns
typed dependencies if successful
Exceptions
RuntimeExceptionexception

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ getStanfordTypedDependencies2()

Collection<TypedDependency> grammarscope.glue.parser.DocumentFactory.getStanfordTypedDependencies2 ( final int  sentenceIdx,
final TypedDependencyMode  mode 
) throws RuntimeException
protected

Get typed dependencies (workflow 2)

Parameters
sentenceIdxsentence
modetyped dependency mode
Returns
typed dependencies if successful
Exceptions
RuntimeExceptionexception

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ getSupportedModes()

TypedDependencyMode [] grammarscope.glue.parser.DocumentFactory.getSupportedModes ( ) throws RuntimeException

Get supported typed dependency modes

Returns
array of supported typed dependency modes
Exceptions
RuntimeExceptionexception

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ getSupportedProviders()

TypedDependencyProvider [] grammarscope.glue.parser.DocumentFactory.getSupportedProviders ( ) throws RuntimeException

Get supported typed dependency providers

Returns
array of supported typed dependency providers
Exceptions
RuntimeExceptionexception

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ getTokens()

List<Token> grammarscope.glue.parser.DocumentFactory.getTokens ( final int  sentenceIdx) throws RuntimeException

Get tokens

Parameters
sentenceIdxsentence index
Returns
tokens
Exceptions
RuntimeExceptionexception

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ init()

boolean grammarscope.glue.parser.DocumentFactory.init ( final String  text)

Init processing

Parameters
textinput text
Returns
true if successful

Reimplemented from grammarscope.glue.AbstractDocumentFactory.

◆ set() [1/8]

static void grammarscope.glue.parser.DocumentFactory.set ( final IDependencyParser  server)
static

Set grammatical structure analyzer

Parameters
serverdependency parser server

◆ set() [2/8]

static void grammarscope.glue.parser.DocumentFactory.set ( final IGrammaticalStructureAnalyzer  server)
static

Set grammatical structure analyzer

Parameters
servergrammatical structure server

◆ set() [3/8]

static void grammarscope.glue.parser.DocumentFactory.set ( final IMorphology  server)
static

Set morphology provider

Parameters
servermorphology server

◆ set() [4/8]

static void grammarscope.glue.parser.DocumentFactory.set ( final IParser  server)
static

Set parser

Parameters
serverparser server

◆ set() [5/8]

static void grammarscope.glue.parser.DocumentFactory.set ( final ISegmenter  server)
static

Set segmenter

Parameters
serversegmenter server

◆ set() [6/8]

static void grammarscope.glue.parser.DocumentFactory.set ( final ISemanticGraphAnalyzer  server)
static

Set semantic graph analyzer

Parameters
serversemantic graph server

◆ set() [7/8]

static void grammarscope.glue.parser.DocumentFactory.set ( final IStanfordServer  server)
static

Set all tools

Parameters
serverserver

◆ set() [8/8]

static void grammarscope.glue.parser.DocumentFactory.set ( final ITypedDependenciesAnalyzer  server)
static

Set typed dependencies analyzer

Parameters
servertyped dependencies server

Member Data Documentation

◆ dependencyParser

IDependencyParser grammarscope.glue.parser.DocumentFactory.dependencyParser
staticprivate

Dependency parser

◆ grammaticalStructureAnalyzer

IGrammaticalStructureAnalyzer grammarscope.glue.parser.DocumentFactory.grammaticalStructureAnalyzer
staticprivate

Grammatical Structure analyzer

◆ grammaticalStructures2

final Cache<GrammaticalStructure> grammarscope.glue.parser.DocumentFactory.grammaticalStructures2
protected

Grammatical structure cache

◆ morphology

IMorphology grammarscope.glue.parser.DocumentFactory.morphology
staticprivate

Morphology analyzer

◆ parser

IParser grammarscope.glue.parser.DocumentFactory.parser
staticprivate

Parser

◆ segmenter

ISegmenter grammarscope.glue.parser.DocumentFactory.segmenter
staticprivate

Segmenter

◆ semanticGraphAnalyzer

ISemanticGraphAnalyzer grammarscope.glue.parser.DocumentFactory.semanticGraphAnalyzer
staticprivate

Semantic graph analyzer

◆ sentenceCoreLabels

List<List<CoreLabel> > grammarscope.glue.parser.DocumentFactory.sentenceCoreLabels
private

Cached word lists (mainly for parser operation)

◆ typedDependencyAnalyzer

ITypedDependenciesAnalyzer grammarscope.glue.parser.DocumentFactory.typedDependencyAnalyzer
staticprivate

Typed Dependency analyzer

◆ typedDependencyModes

final TypedDependencyMode [] grammarscope.glue.parser.DocumentFactory.typedDependencyModes = TypedDependencyMode.values()
staticprivate

◆ typedDependencyProviders

final TypedDependencyProvider [] grammarscope.glue.parser.DocumentFactory.typedDependencyProviders = TypedDependencyProvider.values()
staticprivate

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