Package edu.washington.cs.knowitall.sequence

Examples of edu.washington.cs.knowitall.sequence.SimpleLayeredSequence


   
    String[] words = "There are 5 kinds of owls .".split(" ");
    String[] pos = "EX VBP CD NNS IN NNS .".split(" ");
    String[] np = "O O B-NP I-NP O B-NP O".split(" ");
   
    seq = new SimpleLayeredSequence(words.length);
    seq.addLayer("w", words);
    seq.addLayer("p", pos);
    seq.addLayer("n", np);
  }
View Full Code Here


 
  public List<String> extract(String patternStr, String test) throws SequenceException {
    LayeredTokenPattern pattern = new LayeredTokenPattern(patternStr);
    RegexTagger tagger = new RegexTagger(pattern, "R");
    List<String> testList = listize(test);
    SimpleLayeredSequence seq = new SimpleLayeredSequence(testList.size());
    seq.addLayer("w", testList);
    return tagger.tag(seq);
  }
View Full Code Here

TOP

Related Classes of edu.washington.cs.knowitall.sequence.SimpleLayeredSequence

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.