in ConceptMapper/src/main/java/org/apache/uima/conceptMapper/support/tokens/TokenFilter.java [128:197]
public void initConfig(UimaContext uimaContext) throws AnnotatorConfigurationException {
String[] stopWordList = null;
String[] includedTokenClassStrings = null;
String[] excludedTokenClassStrings = null;
Integer[] includedTokenTypeInts = null;
Integer[] excludedTokenTypeInts = null;
try {
stopWordList = (String[]) uimaContext.getConfigParameterValue(PARAM_STOPWORDS);
includedTokenClassStrings = (String[]) uimaContext
.getConfigParameterValue(PARAM_INCLUDEDTOKENCLASSES);
excludedTokenClassStrings = (String[]) uimaContext
.getConfigParameterValue(PARAM_EXCLUDEDTOKENCLASSES);
includedTokenTypeInts = (Integer[]) uimaContext
.getConfigParameterValue(PARAM_INCLUDEDTOKENTYPES);
excludedTokenTypeInts = (Integer[]) uimaContext
.getConfigParameterValue(PARAM_EXCLUDEDTOKENTYPES);
if ((includedTokenClassStrings == null) || (includedTokenClassStrings.length == 0)) {
includedTokenClasses = null;
} else {
includedTokenClasses = new HashSet<String>();
for (int j = 0; j < includedTokenClassStrings.length; j++) {
includedTokenClasses.add(includedTokenClassStrings[j]);
}
}
if ((excludedTokenClassStrings == null) || (excludedTokenClassStrings.length == 0)) {
excludedTokenClasses = null;
} else {
excludedTokenClasses = new HashSet<String>();
for (int j = 0; j < excludedTokenClassStrings.length; j++) {
excludedTokenClasses.add(excludedTokenClassStrings[j]);
}
}
if ((includedTokenTypeInts == null) || (includedTokenTypeInts.length == 0)) {
includedTokenTypes = null;
} else {
includedTokenTypes = new HashSet<Integer>();
for (int j = 0; j < includedTokenTypeInts.length; j++) {
includedTokenTypes.add(includedTokenTypeInts[j]);
}
}
if ((excludedTokenTypeInts == null) || (excludedTokenTypeInts.length == 0)) {
excludedTokenTypes = null;
} else {
excludedTokenTypes = new HashSet<Integer>();
for (int j = 0; j < excludedTokenTypeInts.length; j++) {
excludedTokenTypes.add(excludedTokenTypeInts[j]);
}
}
if ((includedTokenClasses != null) || (excludedTokenClasses != null)) {
if (tokenClassFeatureName == null) {
throw new AnnotatorConfigurationException();
}
}
if ((includedTokenTypes != null) || (excludedTokenTypes != null)) {
if (tokenTypeFeatureName == null) {
throw new AnnotatorConfigurationException();
}
}
stopWords = initializeStopWordList(stopWordList);
} catch (AnnotatorContextException ie) {
throw new AnnotatorConfigurationException(ie);
}
}