Examples of PatternNode


Examples of edu.harvard.wcfia.yoshikoder.dictionary.PatternNode

                JDialog dia =
                    new EditCategoryDialog(yoshikoder, (CategoryNode)n.getParent(), n);
                dia.show();
               
            } else if (node instanceof PatternNode) {
                PatternNode n = (PatternNode)node;
                JDialog dia =
                    new EditPatternDialog(yoshikoder, (CategoryNode)n.getParent(), n);
                dia.show();
            }
        }
    }
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.dictionary.PatternNode

            Pattern p =
                yoshikoder.getDictionary().getPatternEngine()
                .makeRegexp(name.getText());
           
            Double d = getScore();
            PatternNode node =
                new PatternNodeImpl(name.getText(), d, p);
            if (!node.equals(nodeToEdit)){
                yoshikoder.replaceNode(nodeToEdit, node);
                yoshikoder.setSelectedNode(node);
                yoshikoder.setUnsavedChanges(true);
            }
        } catch (Exception ex){
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.dictionary.PatternNode

              p[ii] = yoshikoder.getDictionary().getPatternEngine().makeRegexp(spl[ii]);
              System.out.println(p[ii].toString());
            }
           
            Double d = getScore();
            PatternNode node = new PatternNodeImpl(newname, d, p);
           
            yoshikoder.getDictionary().addPattern(node, parent);
            yoshikoder.setSelectedNode(parent);
            yoshikoder.setUnsavedChanges(true);
           
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.dictionary.PatternNode

                Node child = en.nextElement();
                recurseHTML(child, sb);
            }
            sb.append("</ul>\n");
        } else {
            PatternNode pn = (PatternNode)n;
            sb.append(toHTML(pn));
        }
    }
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.dictionary.PatternNode

                Node child = en.nextElement();
                recurse(child, sb);
            }
            sb.append("</cnode>\n");
        } else {
            PatternNode pn = (PatternNode)n;
            sb.append(toXML(pn));
        }
    }
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.dictionary.PatternNode

                    d = new Double(Double.parseDouble(score));
                } catch (NumberFormatException nfe){
                    //
                }
            }
            PatternNode pn = null;
            try {
              // deal with multi-patterns here
              String[] spl = name.split(" ");
                Pattern[] p = new Pattern[spl.length];
                engine = dict.getPatternEngine();
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.dictionary.PatternNode

            }
            stack.push(newcat);
            inPattern = false;
            
        } else if (qName.equals("pattern")){ //$NON-NLS-1$
            PatternNode newpat = new PatternNodeImpl("Nameless"); //$NON-NLS-1$
            CategoryNode cparent = (CategoryNode)stack.peek();
            try {
                dict.addPattern(newpat, cparent);
            } catch (DuplicateException de){
                throw new SAXException(de);
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.dictionary.PatternNode

            Node node = (Node)stack.peek();
            node.setName(name);
           
            if (inPattern){
                try {
                    PatternNode pn = (PatternNode)node;
                    Pattern p = engine.makeRegexp(name); // because there will be only one word in it
                    pn.setPattern(p);
                } catch (PatternSyntaxException pse){
                    throw new SAXException(pse);
                }
            }
       
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.dictionary.PatternNode

                    d = new Double(Double.parseDouble(score));
                } catch (NumberFormatException nfe){
                    //
                }
            }
            PatternNode pn = null;
            try {
              // deal with multi-patterns here
              String[] spl = name.split(" ");
                Pattern[] p = new Pattern[spl.length];
                for (int ii = 0; ii < spl.length; ii++)
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.dictionary.PatternNode

                } else if (trimmed.length() > 0) {
                    // no need to fix these for a SubString match-using dictionary
                    //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) {
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.