public class BasicTextAnnotationBuilder extends Object implements TextAnnotationBuilder
To create TextAnnotation
s from plain text, you need a
Tokenizer
. See illinois-tokenizer
for
CogComp's default TextAnnotationBuilder.
SPLIT_ON_DASH
Constructor and Description |
---|
BasicTextAnnotationBuilder() |
Modifier and Type | Method and Description |
---|---|
TextAnnotation |
createTextAnnotation(String text)
A stub method that should not be call with this Builder.
|
TextAnnotation |
createTextAnnotation(String corpusId,
String textId,
String text)
A stub method that should not be call with this Builder.
|
TextAnnotation |
createTextAnnotation(String corpusId,
String textId,
String text,
Tokenizer.Tokenization tokenization)
A method for creating
TextAnnotation by
respecting the pre-tokenization of text passed as an instance of
Tokenizer.Tokenization . |
static TextAnnotation |
createTextAnnotationFromTokens(List<String[]> tokenizedSentences)
The default way to create a
TextAnnotation from pre-tokenized text. |
static TextAnnotation |
createTextAnnotationFromTokens(String corpusId,
String textId,
List<String[]> tokenizedSentences)
The default way to create a
TextAnnotation from pre-tokenized text. |
String |
getName() |
public static TextAnnotation createTextAnnotationFromTokens(List<String[]> tokenizedSentences)
TextAnnotation
from pre-tokenized text.tokenizedSentences
- A list of sentences, each one being an array of tokensTextAnnotation
containing the SENTENCE and TOKENS views.public static TextAnnotation createTextAnnotationFromTokens(String corpusId, String textId, List<String[]> tokenizedSentences)
TextAnnotation
from pre-tokenized text.tokenizedSentences
- A list of sentences, each one being a list of tokensTextAnnotation
containing the SENTENCE and TOKENS views.public TextAnnotation createTextAnnotation(String text) throws IllegalArgumentException
createTextAnnotationFromTokens(java.util.List)
instead.
To create a TextAnnotation
from raw text, please use illinois-tokenizer
createTextAnnotation
in interface TextAnnotationBuilder
text
- Raw text stringIllegalArgumentException
public TextAnnotation createTextAnnotation(String corpusId, String textId, String text) throws IllegalArgumentException
createTextAnnotationFromTokens(java.util.List)
instead.
To create a TextAnnotation
from raw text, please use illinois-tokenizer
createTextAnnotation
in interface TextAnnotationBuilder
text
- Raw text string.IllegalArgumentException
public TextAnnotation createTextAnnotation(String corpusId, String textId, String text, Tokenizer.Tokenization tokenization) throws IllegalArgumentException
TextAnnotationBuilder
TextAnnotation
by
respecting the pre-tokenization of text passed as an instance of
Tokenizer.Tokenization
.createTextAnnotation
in interface TextAnnotationBuilder
text
- Raw text stringtokenization
- An instance containing tokens, character offsets, and sentence
boundaries.IllegalArgumentException
public String getName()
getName
in interface TextAnnotationBuilder
Copyright © 2017. All rights reserved.