this.indexReader = indexReader;
}
public ResultPattern createResultPattern(String pattern) {
PatternParser parser;
try {
parser = new PatternParser(new ByteArrayInputStream(pattern
.getBytes("UTF-8")), "UTF-8");
} catch (UnsupportedEncodingException e1) {
log.error("Cannot encode pattern as UTF-8");
return null;
}
AstTree ast;
try {
parser.setFunctionLookupTable(this.functionMap);
ast = parser.parse();
ResultPattern rp = new ResultPattern(ast, indexReader);
return rp;
} catch (ParseException e) {
log.error("Syntax error in the pattern: " + pattern);
return null;