Package edu.harvard.wcfia.yoshikoder.dictionary

Examples of edu.harvard.wcfia.yoshikoder.dictionary.YKDictionary.addPattern()


    String[] spl = str.split("[^\\w]+");
    List<String> errors = new ArrayList<String>();
    for (int ii = 0; ii < spl.length; ii++) {
      String newpat = spl[ii];
      try {
        dict.addPattern(spl[ii], null, cnode);
      } catch (DuplicateException dex){
        // quietly supress duplicates
      } catch (Exception ex){
        errors.add(spl[ii]);
      }
View Full Code Here


                    dtde.acceptDrop(DnDConstants.ACTION_MOVE);
                    TreePath p = (TreePath)tr.getTransferData(flavors[i]);
                    Node node = (Node)p.getLastPathComponent();
                    YKDictionary dict = (YKDictionary)targetTree.getModel();
                    if (node instanceof PatternNode)
                        dict.addPattern((PatternNode)node, (CategoryNode)parent);
                    else if (node instanceof CategoryNode)
                      dict.addCategory((CategoryNode)node, (CategoryNode)parent);   
                    // Last but not least, mark the drop a success.
                    dtde.dropComplete(true);
                    return;
View Full Code Here

                    //String fixed = fixVBProWildcards(trimmed);
                    try {
                        Pattern regexp = rengine.makeRegexp(trimmed);
                        PatternNode pattern =
                            new PatternNodeImpl(trimmed, null, regexp);
                        dict.addPattern(pattern, cat);
                    } catch (DuplicateException de){
                        errors.add(new BadPattern(lineNumber, trimmed, true));
                    } catch (Exception re) {
                        errors.add(new BadPattern(lineNumber, trimmed, false));
                    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.