public static void main(String[] args) throws Exception { try { if (args.length > 0) { SimplePatternParser pp = new SimplePatternParser(); pp.parse(new FileInputStream(args[0]), pp); } } catch (Exception e) { e.printStackTrace(); } } }
public void text(String str) { StringTokenizer tk = new StringTokenizer(str); while (tk.hasMoreTokens()) { String word = tk.nextToken(); // System.out.println("\"" + word + "\""); switch (currElement) { case ELEM_CLASSES: consumer.addClass(word); break; case ELEM_EXCEPTIONS: exception.add(word); exception = normalizeException(exception); consumer.addException(getExceptionWord(exception), (ArrayList) exception.clone()); exception.clear(); break; case ELEM_PATTERNS: consumer.addPattern(getPattern(word), getInterletterValues(word)); break; } } }
public void text(String str) { StringTokenizer tk = new StringTokenizer(str); while (tk.hasMoreTokens()) { String word = tk.nextToken(); // System.out.println("\"" + word + "\""); switch (currElement) { case ELEM_CLASSES: consumer.addClass(word); break; case ELEM_EXCEPTIONS: exception.add(word); exception = normalizeException(exception); consumer.addException(getExceptionWord(exception), (ArrayList) exception.clone()); exception.clear(); break; case ELEM_PATTERNS: consumer.addPattern(getPattern(word), getInterletterValues(word)); break; } } }
public void text(String str) { StringTokenizer tk = new StringTokenizer(str); while (tk.hasMoreTokens()) { String word = tk.nextToken(); // System.out.println("\"" + word + "\""); switch (currElement) { case ELEM_CLASSES: consumer.addClass(word); break; case ELEM_EXCEPTIONS: exception.add(word); exception = normalizeException(exception); consumer.addException(getExceptionWord(exception), (ArrayList) exception.clone()); exception.clear(); break; case ELEM_PATTERNS: consumer.addPattern(getPattern(word), getInterletterValues(word)); break; } } }
public static void main(String[] args) throws Exception { try { if (args.length > 0) { SimplePatternParser pp = new SimplePatternParser(); pp.parse(new FileInputStream(args[0]), pp); } } catch (Exception e) { e.printStackTrace(); } } }
case ELEM_EXCEPTIONS: exception.add(word); exception = normalizeException(exception); consumer.addException(getExceptionWord(exception), (ArrayList) exception.clone()); break; case ELEM_PATTERNS: consumer.addPattern(getPattern(word), getInterletterValues(word)); break; case ELEM_HYPHEN:
public static void main(String[] args) { try { if (args.length > 0) { SimplePatternParser pp = new SimplePatternParser(); pp.parse(new FileInputStream(args[0]), pp); } } catch (Exception e) { e.printStackTrace(); } } }
case ELEM_EXCEPTIONS: exception.add(word); exception = normalizeException(exception); consumer.addException(getExceptionWord(exception), (ArrayList) exception.clone()); break; case ELEM_PATTERNS: consumer.addPattern(getPattern(word), getInterletterValues(word)); break; case ELEM_HYPHEN:
public void loadSimplePatterns(InputStream stream) { SimplePatternParser pp = new SimplePatternParser(); ivalues = new TernaryTree(); pp.parse(stream, this); // patterns/values should be now in the tree // let's optimize a bit trimToSize(); vspace.trimToSize(); classmap.trimToSize(); // get rid of the auxiliary map ivalues = null; }
case ELEM_EXCEPTIONS: exception.add(word); exception = normalizeException(exception); consumer.addException(getExceptionWord(exception), (ArrayList) exception.clone()); break; case ELEM_PATTERNS: consumer.addPattern(getPattern(word), getInterletterValues(word)); break; case ELEM_HYPHEN:
public void loadSimplePatterns(InputStream stream) { SimplePatternParser pp = new SimplePatternParser(); ivalues = new TernaryTree(); pp.parse(stream, this); // patterns/values should be now in the tree // let's optimize a bit trimToSize(); vspace.trimToSize(); classmap.trimToSize(); // get rid of the auxiliary map ivalues = null; }
public void loadSimplePatterns(InputStream stream) { SimplePatternParser pp = new SimplePatternParser(); ivalues = new TernaryTree(); pp.parse(stream, this); // patterns/values should be now in the tree // let's optimize a bit trimToSize(); vspace.trimToSize(); classmap.trimToSize(); // get rid of the auxiliary map ivalues = null; }