public class DocumentFactory extends AbstractDocumentFactory
AbstractDocumentFactory.Cache<T>
Modifier and Type | Field and Description |
---|---|
private IPipelineAnnotation |
annotation
Annotation (of text)
|
private static Pipeline |
pipeline
Stanford pipeline
|
grammaticalStructures, language, parseTrees, relationDependentsDirectFactory, text, tokens, typedDependencies, typedDependencies2, xMLPrinter
Constructor and Description |
---|
DocumentFactory(Language language)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Segmentation |
getSegmentation()
Get segmentation
|
java.util.List<SentenceSegment> |
getSentences()
Get sentences
|
protected Coreferences |
getStanfordCoreferences()
Get coreferences
|
protected java.util.List<Entailment> |
getStanfordEntailments(int sentenceIdx)
Get entailments
|
protected edu.stanford.nlp.trees.GrammaticalStructure |
getStanfordGrammaticalStructure(int sentenceIdx)
Get grammatical structure
|
protected java.util.List<NamedEntity> |
getStanfordNamedEntities(int sentenceIdx)
Get named entities
|
protected edu.stanford.nlp.trees.Tree |
getStanfordParseTree(int sentenceIdx)
Get parse tree
|
protected edu.stanford.nlp.semgraph.SemanticGraph |
getStanfordSemanticGraph(int sentenceIdx,
TypedDependencyMode mode)
Get semantic graph
|
protected edu.stanford.nlp.semgraph.SemanticGraph |
getStanfordSemanticGraph2(int sentenceIdx,
TypedDependencyMode mode)
Get semantic graph (workflow 2)
|
protected Sentiment |
getStanfordSentiment(int sentenceIdx)
Get sentiment
|
protected java.util.List<Triple> |
getStanfordTriples(int sentenceIdx)
Get triples
|
protected java.util.Collection<edu.stanford.nlp.trees.TypedDependency> |
getStanfordTypedDependencies(int sentenceIdx,
TypedDependencyMode mode)
Get typed dependencies
|
protected java.util.Collection<edu.stanford.nlp.trees.TypedDependency> |
getStanfordTypedDependencies2(int sentenceIdx,
TypedDependencyMode mode)
Get typed dependencies (workflow 2)
|
TypedDependencyMode[] |
getSupportedModes()
Get supported typed dependency modes
|
TypedDependencyProvider[] |
getSupportedProviders()
Get supported typed dependency providers
|
java.util.List<Token> |
getTokens(int sentenceIdx)
Get tokens
|
java.util.List<WordSegment> |
getWords()
Get words
|
boolean |
init(java.lang.String text)
Init processing
|
static void |
set(Pipeline pipeline)
Set pipeline to use
|
getAnalysis, getCoreferences, getEntailments, getGrammaticalStructure, getNamedEntities, getParseTree, getPoses, getRelationDependents, getReport, getReports, getSemanticGraph, getSemanticGraphs, getSentenceCount, getSentiment, getText, getTextAnalysis, getTextReport, getTextReports, getTriples, getTypedDependencies, getTypedDependencies
private static Pipeline pipeline
private IPipelineAnnotation annotation
public DocumentFactory(Language language)
language
- languagepublic static void set(Pipeline pipeline)
pipeline
- pipelinepublic boolean init(java.lang.String text)
IDocumentFactory
init
in interface IDocumentFactory
init
in class AbstractDocumentFactory
text
- input textpublic java.util.List<WordSegment> getWords() throws java.lang.RuntimeException
IDocumentFactoryService
getWords
in interface IDocumentFactoryService
getWords
in class AbstractDocumentFactory
java.lang.RuntimeException
public java.util.List<SentenceSegment> getSentences() throws java.lang.RuntimeException
IDocumentFactoryService
getSentences
in interface IDocumentFactoryService
getSentences
in class AbstractDocumentFactory
java.lang.RuntimeException
public Segmentation getSegmentation() throws java.lang.RuntimeException
AbstractDocumentFactory
getSegmentation
in class AbstractDocumentFactory
java.lang.RuntimeException
- exceptionpublic java.util.List<Token> getTokens(int sentenceIdx) throws java.lang.RuntimeException
AbstractDocumentFactory
getTokens
in interface IDocumentFactoryService
getTokens
in class AbstractDocumentFactory
sentenceIdx
- sentence indexjava.lang.RuntimeException
- exceptionprotected edu.stanford.nlp.trees.Tree getStanfordParseTree(int sentenceIdx) throws java.lang.RuntimeException
AbstractDocumentFactory
getStanfordParseTree
in class AbstractDocumentFactory
sentenceIdx
- sentence indexjava.lang.RuntimeException
- exceptionprotected edu.stanford.nlp.trees.GrammaticalStructure getStanfordGrammaticalStructure(int sentenceIdx) throws java.lang.RuntimeException
AbstractDocumentFactory
getStanfordGrammaticalStructure
in class AbstractDocumentFactory
sentenceIdx
- sentencejava.lang.RuntimeException
protected java.util.Collection<edu.stanford.nlp.trees.TypedDependency> getStanfordTypedDependencies(int sentenceIdx, TypedDependencyMode mode) throws java.lang.RuntimeException
AbstractDocumentFactory
getStanfordTypedDependencies
in class AbstractDocumentFactory
sentenceIdx
- sentencemode
- typed dependency modejava.lang.RuntimeException
- exceptionprotected java.util.Collection<edu.stanford.nlp.trees.TypedDependency> getStanfordTypedDependencies2(int sentenceIdx, TypedDependencyMode mode) throws java.lang.RuntimeException
AbstractDocumentFactory
getStanfordTypedDependencies2
in class AbstractDocumentFactory
sentenceIdx
- sentencemode
- typed dependency modejava.lang.RuntimeException
- exceptionpublic TypedDependencyProvider[] getSupportedProviders() throws java.lang.RuntimeException
AbstractDocumentFactory
getSupportedProviders
in interface IDocumentFactoryService
getSupportedProviders
in class AbstractDocumentFactory
java.lang.RuntimeException
- exceptionpublic TypedDependencyMode[] getSupportedModes() throws java.lang.RuntimeException
AbstractDocumentFactory
getSupportedModes
in interface IDocumentFactoryService
getSupportedModes
in class AbstractDocumentFactory
java.lang.RuntimeException
- exceptionprotected edu.stanford.nlp.semgraph.SemanticGraph getStanfordSemanticGraph(int sentenceIdx, TypedDependencyMode mode) throws java.lang.RuntimeException
AbstractDocumentFactory
getStanfordSemanticGraph
in class AbstractDocumentFactory
sentenceIdx
- sentencemode
- typed dependency modejava.lang.RuntimeException
protected edu.stanford.nlp.semgraph.SemanticGraph getStanfordSemanticGraph2(int sentenceIdx, TypedDependencyMode mode) throws java.lang.RuntimeException
AbstractDocumentFactory
getStanfordSemanticGraph2
in class AbstractDocumentFactory
sentenceIdx
- sentencemode
- typed dependency modejava.lang.RuntimeException
protected java.util.List<NamedEntity> getStanfordNamedEntities(int sentenceIdx) throws java.lang.RuntimeException
AbstractDocumentFactory
getStanfordNamedEntities
in class AbstractDocumentFactory
sentenceIdx
- sentence indexjava.lang.RuntimeException
- exceptionprotected Sentiment getStanfordSentiment(int sentenceIdx) throws java.lang.RuntimeException
AbstractDocumentFactory
getStanfordSentiment
in class AbstractDocumentFactory
sentenceIdx
- sentence indexjava.lang.RuntimeException
protected java.util.List<Entailment> getStanfordEntailments(int sentenceIdx) throws java.lang.RuntimeException
AbstractDocumentFactory
getStanfordEntailments
in class AbstractDocumentFactory
sentenceIdx
- sentence indexjava.lang.RuntimeException
protected java.util.List<Triple> getStanfordTriples(int sentenceIdx) throws java.lang.RuntimeException
AbstractDocumentFactory
getStanfordTriples
in class AbstractDocumentFactory
sentenceIdx
- sentence indexjava.lang.RuntimeException
protected Coreferences getStanfordCoreferences() throws java.lang.RuntimeException
AbstractDocumentFactory
getStanfordCoreferences
in class AbstractDocumentFactory
java.lang.RuntimeException