// default initialization for number format
this.floatNumberFormat = NumberFormat.getNumberInstance();
this.integerNumberFormat = NumberFormat.getIntegerInstance();
// create a concept file parser object
ConceptFileParser parser = new ConceptFileParser_impl();
// get configuration parameter settings
// get parameter ConceptFiles, default is an empty array
String[] conceptFileNames = safeGetConfigParameterStringArrayValue(getContext(),
REGEX_CONCEPTS_FILES, new String[] {});
// get UIMA datapath and tokenize it into its elements
StringTokenizer tokenizer = new StringTokenizer(getContext().getDataPath(), PATH_SEPARATOR);
ArrayList<File> datapathElements = new ArrayList<File>();
while (tokenizer.hasMoreTokens()) {
// add datapath elements to the 'datapathElements' array list
datapathElements.add(new File(tokenizer.nextToken()));
}
// try to resolve the concept file names
ArrayList<Concept> concepts = new ArrayList<Concept>();
for (int i = 0; i < conceptFileNames.length; i++) {
// try to resolve the relative file name with classpath or datapath
String filename = conceptFileNames[i];
List<ConceptFile> cfList = new ArrayList<ConceptFile>();
if (containsWildcardChar(filename)) {
resolveRelativeWildcardFilePath(filename, datapathElements, cfList);
} else {
ConceptFile file = resolveRelativeFilePath(filename, datapathElements);
// if the current concept file wasn't found, throw an exception
if (file == null) {
throw new RegexAnnotatorConfigException("regex_annotator_resource_not_found",
new Object[] { conceptFileNames[i] });
}
cfList.add(file);
// log concept file path
this.logger.logrb(Level.CONFIG, "RegExAnnotator", "initialize", MESSAGE_DIGEST,
"regex_annotator_rule_set_file", new Object[] { file.getFilePath() });
}
for (ConceptFile file : cfList) {
// parse concept file to internal objects
Concept[] currentConcepts = parser.parseConceptFile(file.getFilePath(), file.getStream());
try {
file.getStream().close();
} catch (IOException e) {
this.logger.logrb(Level.WARNING, "RegExAnnotator", "initialize", MESSAGE_DIGEST,
"regex_annotator_error_closing_input_stream", new Object[] { file.getFilePath(),