Interface NaturalLanguageProcessing

  • All Known Implementing Classes:
    ParseProcessing

    public interface NaturalLanguageProcessing
    Interface for NaturalLanguageProcessing. Classes implementing this interface can be used to process texts or Documents.
    Author:
    Jan Keim
    • Method Detail

      • init

        void init​(Document document)
        Initialise the NLP with the given Document
        Parameters:
        document - Document that should be able to be processed
      • init

        void init​(String text,
                  String documentId)
        Initialise the NLP for the given text with the given Id.
        Parameters:
        text - text that should be able to be processed
        documentId - Id of the text/document
      • getNamedEntityWords

        List<? extends Word> getNamedEntityWords()
        Returns:
        List of NamedEntities that were found within the init. text
      • getWords

        List<? extends Word> getWords()
        Returns:
        List of words that were found within the init. text.
      • getNounPhrases

        List<? extends Phrase> getNounPhrases()
        Returns:
        List of NounPhrases that were found within the init. text.
      • getPhrases

        List<? extends Phrase> getPhrases()
        Returns:
        List of Phrases that were found within the init. text.
      • getSentences

        List<? extends Sentence> getSentences()
        Returns:
        List of Sentences that were found within the init. text.
      • getCoreferences

        List<? extends Coreference> getCoreferences()
        Returns:
        List of Coreferences that were found within the init. text.
      • getPhraseOfWord

        Optional<? extends Phrase> getPhraseOfWord​(Word word)
        Returns the Phrase the given word is contained in. If the word is not contained in any phrase, an empty Optional is returned.
        Parameters:
        word - Word that should be looked for in Phrases
        Returns:
        Optional containing the Phrase the given word is contained in. Empty Optional if word is not contained in any phrase.
      • getDocument

        Document getDocument()
        Returns:
        the document the NLP is initialised with.
      • annotate

        void annotate​(TextElement textElement,
                      Annotation annotation)
        Adds the given Annotation to the provided TextElement
        Parameters:
        textElement - textElement that should be annotated
        annotation - the Annotation
      • toDebugString

        String toDebugString()
        Returns:
        a string containing debug information
      • toExtensiveDebugString

        String toExtensiveDebugString()
        Returns:
        a string containing extensive debug information