Package edu.washington.cs.knowitall.extractor

Examples of edu.washington.cs.knowitall.extractor.RegexExtractor


    }

    @Test
    public void testExtract1() throws Exception {
        String pattern = "(" + verb + np + prep + "|" + verb + ")+";
        RegexExtractor extractor = new RegexExtractor(pattern);
        Iterable<ChunkedExtraction> extrIter = extractor.extract(sent1);
        List<ChunkedExtraction> extrs = new ArrayList<ChunkedExtraction>();
        Iterables.addAll(extrs, extrIter);
        Assert.assertEquals(1, extrs.size());

        ChunkedExtraction extr = extrs.get(0);
View Full Code Here


  ExtractorUnion<ChunkedSentence, ChunkedExtraction> e2;
  ExtractorUnion<ChunkedSentence, ChunkedExtraction> e3;

  @Before
  public void setUp() throws Exception {
    RegexExtractor r1 = new RegexExtractor("wants_tok to_tok");
    RegexExtractor r2 = new RegexExtractor("go_tok to_tok");
    RegexExtractor r3 = new RegexExtractor("to_tok go_tok to_tok");
   
    e1 = new ExtractorUnion<ChunkedSentence, ChunkedExtraction>();
    e1.addExtractor(r1);
    e1.addExtractor(r2);
    e1.addMapper(new MergeOverlappingMapper());
View Full Code Here

TOP

Related Classes of edu.washington.cs.knowitall.extractor.RegexExtractor

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.