Collection<TypeSystemDescription> tsds = new ArrayList<TypeSystemDescription>();
tsds.add(basicTypeSystem);
TypeSystemDescription mergeTypeSystems = CasCreationUtils.mergeTypeSystems(tsds);
aed.getAnalysisEngineMetaData().setTypeSystem(mergeTypeSystems);
AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(specifier);
ae.setConfigParameterValue(RutaEngine.PARAM_SCRIPT_PATHS, new String[] { ruleFile
.getParentFile().getPath() });
String name = ruleFile.getName();
if (name.endsWith(RutaEngine.SCRIPT_FILE_EXTENSION)) {
name = name.substring(0, name.length() - 5);
}
ae.setConfigParameterValue(RutaEngine.PARAM_MAIN_SCRIPT, name);
ae.setConfigParameterValue(RutaEngine.PARAM_SEEDERS, new String[0]);
ae.setConfigParameterValue(RutaEngine.PARAM_DEFAULT_FILTERED_TYPES, new String[0]);
ae.reconfigure();
CAS cas = ae.newCAS();
cas.setDocumentText(FileUtils.file2String(textFile, "UTF-8"));
Type typeCW = cas.getTypeSystem().getType("org.apache.uima.ruta.type.CW");
Type typeSW = cas.getTypeSystem().getType("org.apache.uima.ruta.type.SW");
cas.addFsToIndexes(cas.createAnnotation(typeCW, 0, 5));
cas.addFsToIndexes(cas.createAnnotation(typeCW, 7, 13));
cas.addFsToIndexes(cas.createAnnotation(typeCW, 15, 18));
cas.addFsToIndexes(cas.createAnnotation(typeSW, 19, 22));
cas.addFsToIndexes(cas.createAnnotation(typeCW, 23, 28));
ae.process(cas);
Type t = null;
AnnotationIndex<AnnotationFS> ai = null;
FSIterator<AnnotationFS> iterator = null;