public class QuoteAnnotator extends Object implements Annotator
Annotator.Requirement| Modifier and Type | Field and Description |
|---|---|
boolean |
closeUnclosedQuotes |
static Map<String,String> |
DIRECTED_QUOTES |
static String[] |
QUOTES |
BINARIZED_TREES_REQUIREMENT, CLEAN_XML_REQUIREMENT, COLUMN_DATA_CLASSIFIER, DETERMINISTIC_COREF_REQUIREMENT, GENDER_REQUIREMENT, GUTIME_REQUIREMENT, HEIDELTIME_REQUIREMENT, LEMMA_REQUIREMENT, NATLOG_REQUIREMENT, NER_REQUIREMENT, NUMBER_REQUIREMENT, PARSE_AND_TAG, PARSE_REQUIREMENT, PARSE_TAG_BINARIZED_TREES, POS_REQUIREMENT, QUANTIFIABLE_ENTITY_NORMALIZATION_REQUIREMENT, QUOTE_REQUIREMENT, RELATION_EXTRACTOR_REQUIREMENT, SSPLIT_REQUIREMENT, STANFORD_CLEAN_XML, STANFORD_COLUMN_DATA_CLASSIFIER, STANFORD_DEPENDENCIES, STANFORD_DETERMINISTIC_COREF, STANFORD_ENTITY_MENTIONS, STANFORD_GENDER, STANFORD_LEMMA, STANFORD_NATLOG, STANFORD_NER, STANFORD_PARSE, STANFORD_POS, STANFORD_QUOTE, STANFORD_REGEXNER, STANFORD_RELATION, STANFORD_SENTIMENT, STANFORD_SSPLIT, STANFORD_TOKENIZE, STANFORD_TRUECASE, STEM_REQUIREMENT, SUTIME_REQUIREMENT, TIME_WORDS_REQUIREMENT, TOKENIZE_AND_SSPLIT, TOKENIZE_REQUIREMENT, TOKENIZE_SSPLIT_NER, TOKENIZE_SSPLIT_PARSE, TOKENIZE_SSPLIT_PARSE_NER, TOKENIZE_SSPLIT_POS, TOKENIZE_SSPLIT_POS_LEMMA, TRUECASE_REQUIREMENT| Constructor and Description |
|---|
QuoteAnnotator(Properties props)
Return a QuoteAnnotator that isolates quotes denoted by the
ASCII characters " and '.
|
QuoteAnnotator(Properties props,
boolean verbose)
Return a QuoteAnnotator that isolates quotes denoted by the
ASCII characters " and '.
|
| Modifier and Type | Method and Description |
|---|---|
void |
annotate(Annotation annotation)
Given an Annotation, perform a task on this Annotation.
|
static List<CoreMap> |
getCoreMapQuotes(List<Pair<Integer,Integer>> quotes,
List<CoreLabel> tokens,
String text,
String docID) |
static Comparator<CoreMap> |
getQuoteComparator() |
static List<Pair<Integer,Integer>> |
getQuotes(String text) |
static boolean |
isSingleQuote(String c) |
static boolean |
isWhitespaceOrPunct(String c) |
static Annotation |
makeQuote(String text,
int begin,
int end,
List<CoreLabel> quoteTokens,
int currQuoteSize,
int tokenOffset,
String docID) |
static List<Pair<Integer,Integer>> |
recursiveQuotes(String text,
int offset,
String prevQuote) |
Set<Annotator.Requirement> |
requirementsSatisfied()
Returns a set of requirements for which tasks this annotator can
provide.
|
Set<Annotator.Requirement> |
requires()
Returns the set of tasks which this annotator requires in order
to perform.
|
public static final String[] QUOTES
public final boolean closeUnclosedQuotes
public QuoteAnnotator(Properties props)
props - Properties object that contains the customizable properties
attributes.public QuoteAnnotator(Properties props, boolean verbose)
props - Properties object that contains the customizable properties
attributes.verbose - whether or not to output verbose information.public void annotate(Annotation annotation)
Annotatorpublic static Comparator<CoreMap> getQuoteComparator()
public static List<CoreMap> getCoreMapQuotes(List<Pair<Integer,Integer>> quotes, List<CoreLabel> tokens, String text, String docID)
public static Annotation makeQuote(String text, int begin, int end, List<CoreLabel> quoteTokens, int currQuoteSize, int tokenOffset, String docID)
public static List<Pair<Integer,Integer>> recursiveQuotes(String text, int offset, String prevQuote)
public static boolean isWhitespaceOrPunct(String c)
public static boolean isSingleQuote(String c)
public Set<Annotator.Requirement> requires()
Annotatorpublic Set<Annotator.Requirement> requirementsSatisfied()
AnnotatorrequirementsSatisfied in interface Annotator