Package edu.kit.ipd.are.archdoclink.nlp
Interface NaturalLanguageProcessing
-
- All Known Implementing Classes:
ParseProcessing
public interface NaturalLanguageProcessingInterface for NaturalLanguageProcessing. Classes implementing this interface can be used to process texts orDocuments.- Author:
- Jan Keim
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidannotate(TextElement textElement, Annotation annotation)Adds the givenAnnotationto the providedTextElementList<? extends Coreference>getCoreferences()DocumentgetDocument()List<? extends Word>getNamedEntityWords()List<? extends Phrase>getNounPhrases()Optional<? extends Phrase>getPhraseOfWord(Word word)Returns the Phrase the given word is contained in.List<? extends Phrase>getPhrases()List<? extends Sentence>getSentences()List<? extends Word>getWords()voidinit(Document document)Initialise the NLP with the givenDocumentvoidinit(String text, String documentId)Initialise the NLP for the given text with the given Id.StringtoDebugString()StringtoExtensiveDebugString()
-
-
-
Method Detail
-
init
void init(Document document)
Initialise the NLP with the givenDocument- 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 processeddocumentId- 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 emptyOptionalis 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 givenAnnotationto the providedTextElement- Parameters:
textElement- textElement that should be annotatedannotation- the Annotation
-
toDebugString
String toDebugString()
- Returns:
- a string containing debug information
-
toExtensiveDebugString
String toExtensiveDebugString()
- Returns:
- a string containing extensive debug information
-
-