Class ParseDocument
- java.lang.Object
-
- edu.kit.ipd.are.archdoclink.nlp.parse.ParseDocument
-
- All Implemented Interfaces:
Annotatable,Document,Identifiable,TextElement
public class ParseDocument extends Object implements Document
-
-
Constructor Summary
Constructors Constructor Description ParseDocument(edu.kit.ipd.parse.luna.graph.IGraph graph, String documentId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidannotate(Annotation annotation)Annotates the given annotation to this document.edu.kit.ipd.parse.luna.graph.INodecreateNodeForPhrase(ParsePhrase phrase)Creates a node for a phrase.voidcreateReference(edu.kit.ipd.parse.luna.graph.INode node, Annotation annotation)Creates a reference from the given node to the given annotation.voidcreateReference(List<ParseWord> words, Annotation annotation)Creates a reference from the given annotation to the given words.booleanequals(Object obj)List<ParseCoreference>getCoreferences()StringgetId()org.eclipse.collections.api.list.MutableList<ParseWord>getNamedEntityWords()org.eclipse.collections.api.list.MutableList<ParsePhrase>getNounPhrases()org.eclipse.collections.api.list.MutableList<ParsePhrase>getPhrases()org.eclipse.collections.api.list.MutableList<ParsePhrase>getPhrasesOfType(PhraseType type)CalendargetProcessingDate()org.eclipse.collections.api.list.MutableList<ParseSentence>getSentences()StringgetText()org.eclipse.collections.api.list.MutableList<ParseWord>getWords()inthashCode()StringtoDebugString()StringtoExtensiveDebugString()StringtoString()
-
-
-
Constructor Detail
-
ParseDocument
public ParseDocument(edu.kit.ipd.parse.luna.graph.IGraph graph, String documentId)
-
-
Method Detail
-
getNamedEntityWords
public org.eclipse.collections.api.list.MutableList<ParseWord> getNamedEntityWords()
- Specified by:
getNamedEntityWordsin interfaceDocument
-
getWords
public org.eclipse.collections.api.list.MutableList<ParseWord> getWords()
-
getPhrases
public org.eclipse.collections.api.list.MutableList<ParsePhrase> getPhrases()
- Specified by:
getPhrasesin interfaceDocument- Returns:
- List of all phrases of the document. The phrases are ordered by appearance.
-
getNounPhrases
public org.eclipse.collections.api.list.MutableList<ParsePhrase> getNounPhrases()
- Specified by:
getNounPhrasesin interfaceDocument- Returns:
- List of all Noun phrases of the document. The phrases are ordered by appearance.
-
getPhrasesOfType
public org.eclipse.collections.api.list.MutableList<ParsePhrase> getPhrasesOfType(PhraseType type)
- Specified by:
getPhrasesOfTypein interfaceDocument- Parameters:
type- type of phrase- Returns:
- list of phrase of the specific phrasetype contained in the sentence
-
getSentences
public org.eclipse.collections.api.list.MutableList<ParseSentence> getSentences()
- Specified by:
getSentencesin interfaceDocument- Returns:
- List of all sentences within the document. The sentences are ordered by appearance.
-
getText
public String getText()
- Specified by:
getTextin interfaceTextElement- Returns:
- the text of the element
-
getCoreferences
public List<ParseCoreference> getCoreferences()
- Specified by:
getCoreferencesin interfaceDocument
-
getId
public String getId()
- Specified by:
getIdin interfaceIdentifiable- Returns:
- the Id
-
getProcessingDate
public Calendar getProcessingDate()
- Specified by:
getProcessingDatein interfaceDocument- Returns:
- the processing date of the document.
-
toDebugString
public String toDebugString()
-
toExtensiveDebugString
public String toExtensiveDebugString()
-
annotate
public void annotate(Annotation annotation)
Description copied from interface:DocumentAnnotates the given annotation to this document.- Specified by:
annotatein interfaceDocument- Parameters:
annotation-Annotationthat should be annotated to this document.
-
createReference
public void createReference(List<ParseWord> words, Annotation annotation)
Creates a reference from the given annotation to the given words. Searches the graph for theINodecorresponding to the annotation or throws anIllegalArgumentExceptionwhen no node is found.- Parameters:
words- Words that should be referencedannotation- Annotation that references the word
-
createReference
public void createReference(edu.kit.ipd.parse.luna.graph.INode node, Annotation annotation)Creates a reference from the given node to the given annotation. The annotation needs to have an arcName set.- Parameters:
node- Node where the reference beginsannotation- annotation where the reference should head to
-
createNodeForPhrase
public edu.kit.ipd.parse.luna.graph.INode createNodeForPhrase(ParsePhrase phrase)
Creates a node for a phrase.- Parameters:
phrase- Phrase for which a node should be created- Returns:
- the created node
-
-