Package edu.washington.cs.knowitall.sequence

Examples of edu.washington.cs.knowitall.sequence.LayeredTokenMatcher.find()


        try {

            LayeredTokenMatcher m = pattern.matcher(sentence);
            Collection<ChunkedExtraction> results = new ArrayList<ChunkedExtraction>();

            while (m.find()) {
                int start = m.start();
                int length = m.end() - start;
                Range r = new Range(start, length);
                ChunkedExtraction extr = new ChunkedExtraction(sentence, r);
                results.add(extr);
View Full Code Here


        return new Predicate<ChunkedBinaryExtraction>() {
            public boolean apply(ChunkedBinaryExtraction e) {
                try {
                    LayeredTokenMatcher m = pattern.matcher(e.getRelation());
                    int n = 0;
                    while (m.find())
                        n++;
                    return n == 1;
                } catch (SequenceException ex) {
                    throw new IllegalStateException(ex);
                }
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.