@Override
public void initialize(UimaContext context)
throws ResourceInitializationException {
super.initialize(context);
CombinedExtractor charExtractors = new CombinedExtractor(new CharacterCategoryPatternExtractor(PatternType.REPEATS_MERGED),
new CharacterCategoryPatternExtractor(PatternType.ONE_PER_CHAR));
this.wordTypes = Maps.newHashMap();
URL url = TimeWordsExtractor.class.getResource(LOOKUP_PATH);
try {
for (String line : Resources.readLines(url, Charsets.US_ASCII)) {
String[] typeAndWord = line.split("\\s+");
if (typeAndWord.length != 2) {
throw new IllegalArgumentException("Expected '<type> <word>', found: " + line);
}
this.wordTypes.put(typeAndWord[1], typeAndWord[0]);
}
} catch (IOException e) {
throw new ResourceInitializationException(e);
}
CombinedExtractor allExtractors = new CombinedExtractor(
new CoveredTextExtractor(),
// new TimeWordTypeExtractor(),
charExtractors,
new TypePathExtractor(BaseToken.class, "partOfSpeech"));