Package edu.washington.cs.knowitall.commonlib

Examples of edu.washington.cs.knowitall.commonlib.Range


        }
        while (i > -1) {
            int start = i;
            int length = extr.getStart() - i;
            if ((matches(ChunkedSentenceToken.tokenize(extr.getSentence(),
                    new Range(start, length)), "subj_4", true))
                    || (extr.getSentence().getPosTag(extr.getStart())
                            .equals("VBN")
                            && (matches(ChunkedSentenceToken.tokenize(
                                    extr.getSentence(),
                                    new Range(start, length)), "subj_6", true)) || (npcount < 1
                            && (matches(ChunkedSentenceToken.tokenize(
                                    extr.getSentence(),
                                    new Range(start, length)), "subj_5a", true))
                            || (matches(ChunkedSentenceToken.tokenize(
                                    extr.getSentence(),
                                    new Range(start, length)), "subj_5b", true)) || (matches(
                                ChunkedSentenceToken.tokenize(extr
                                        .getSentence(),
                                        new Range(start, length)), "subj_5c",
                                true))))) {
                return true;
            }
            i--;
        }
View Full Code Here


        }
        return false;
    }

    public boolean appClause(ChunkedExtraction extr, int current) {
        List<ChunkedSentenceToken> tocheck = ChunkedSentenceToken.tokenize(extr.getSentence(), new Range(current,
                extr.getSentence().getLength() - current));
        // matches pattern
        if (matches(tocheck, "app_1", false)
                || matches(tocheck, "app_2", false)) {
            return true;
View Full Code Here

        }
        return false;
    }

    public boolean vbgIsNext(ChunkedExtraction extr, int current) {
        List<ChunkedSentenceToken> tocheck = ChunkedSentenceToken.tokenize(extr.getSentence(), new Range(current,
                extr.getSentence().getLength() - current));
        // matches pattern
        if (matches(tocheck, "vbg_1", false)
                || matches(tocheck, "vbg_2", false)) {
            return true;
View Full Code Here

        }
        return false;
    }

    public boolean relClause(ChunkedExtraction extr, int current) {
        List<ChunkedSentenceToken> tocheck = ChunkedSentenceToken.tokenize(extr.getSentence(), new Range(current,
                extr.getSentence().getLength() - current));
        // matches pattern
        if (matches(tocheck, "relclause1", false)
                || matches(tocheck, "relclause2", false)
                || matches(tocheck, "relclause3", false)) {
View Full Code Here

        }
        if (start < 0) {
            return false;
        }
        int length = extr.getSentence().getLength() - start;
        List<ChunkedSentenceToken> tocheck = ChunkedSentenceToken.tokenize(extr.getSentence(), new Range(start,
                length));

        // match patterns
        boolean matches1 = matches(tocheck, "np_list", false);
        boolean matches2 = matches(tocheck, "np_list_cc", false);
View Full Code Here

                    || extr.getSentence().getChunkTag(i).contains("B-VP")) {
                start = i;
            }
        }
        int end = extr.getSentence().getLength();
        return ChunkedSentenceToken.tokenize(extr.getSentence(), new Range(start, end - start));
    }
View Full Code Here

    public static List<ChunkedSentenceToken> getChunkedSentenceFromPredEnd(
            ChunkedExtraction extr) {
        int start = extr.getStart() + extr.getLength();
        int end = extr.getSentence().getLength();
        return ChunkedSentenceToken.tokenize(extr.getSentence(), new Range(start, end - start));
    }
View Full Code Here

                int start = m.start(i + 1);
                int end = m.end(i + 1);
                int len = end - start;
                if (start < 0 || end < 0)
                    break;
                fieldRanges.add(new Range(start, len));
            }
            if (fieldRanges.size() > 0) {
                SpanExtraction extr = new SpanExtraction(sent, fieldRanges);
                results.add(extr);
            }
View Full Code Here

            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);
            }
            return results;
View Full Code Here

     * @param ranges a collection of <code>Range</code> objects.
     * @return a new collection of <code>Range</code> objects.
     */
    private Collection<Range> removeRangeOverlapWithRelation(ChunkedExtraction rel, Iterable<Range> ranges) {
        Collection<Range> results = new ArrayList<Range>();
        Range relRange = rel.getRange();
        for (Range range : ranges) {
          Range result = range.removeOverlap(relRange);
          if (result != null) {
              results.add(result);
          }
        }
        return results;
View Full Code Here

TOP

Related Classes of edu.washington.cs.knowitall.commonlib.Range

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.