Package net.sf.clairv.search.pattern.bnf

Examples of net.sf.clairv.search.pattern.bnf.PatternParser


    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;
View Full Code Here

TOP

Related Classes of net.sf.clairv.search.pattern.bnf.PatternParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.