Class ParseDocument

    • Constructor Detail

      • ParseDocument

        public ParseDocument​(edu.kit.ipd.parse.luna.graph.IGraph graph,
                             String documentId)
    • Method Detail

      • getWords

        public org.eclipse.collections.api.list.MutableList<ParseWord> getWords()
        Specified by:
        getWords in interface Document
        Returns:
        List of all words within the document. The words are ordered by appearance.
      • getPhrases

        public org.eclipse.collections.api.list.MutableList<ParsePhrase> getPhrases()
        Specified by:
        getPhrases in interface Document
        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:
        getNounPhrases in interface Document
        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:
        getPhrasesOfType in interface Document
        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:
        getSentences in interface Document
        Returns:
        List of all sentences within the document. The sentences are ordered by appearance.
      • toDebugString

        public String toDebugString()
      • toExtensiveDebugString

        public String toExtensiveDebugString()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • annotate

        public void annotate​(Annotation annotation)
        Description copied from interface: Document
        Annotates the given annotation to this document.
        Specified by:
        annotate in interface Document
        Parameters:
        annotation - Annotation that 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 the INode corresponding to the annotation or throws an IllegalArgumentException when no node is found.
        Parameters:
        words - Words that should be referenced
        annotation - 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 begins
        annotation - 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