@Test(expected=SequenceException.class) public void testMatcher6() throws Exception { String patternStr = "B-NP_np I-NP_np* from_word the_word B-NP_np I-NP_np*"; LayeredTokenPattern pattern = new LayeredTokenPattern(patternStr); OpenNlpSentenceChunker chunker = new OpenNlpSentenceChunker(); pattern.matcher(chunker.chunkSentence("Hello, world.")); }
public LayeredTokenMatcher matcher(LayeredSequence seq) throws SequenceException { String encoded = encodeSequence(seq); Matcher m = encodedPattern.matcher(encoded); return new LayeredTokenMatcher(m); }
LayeredTokenPattern { public LayeredTokenMatcher matcher(LayeredSequence seq) throws SequenceException { String encoded = encodeSequence(seq); Matcher m = encodedPattern.matcher(encoded); return new LayeredTokenMatcher(m); } }
LayeredTokenPattern { public LayeredTokenMatcher matcher(LayeredSequence seq) throws SequenceException { String encoded = encodeSequence(seq); Matcher m = encodedPattern.matcher(encoded); return new LayeredTokenMatcher(m); } LayeredTokenPattern(String patternString); }
LayeredTokenPattern { public LayeredTokenMatcher matcher(LayeredSequence seq) throws SequenceException { String encoded = encodeSequence(seq); Matcher m = encodedPattern.matcher(encoded); return new LayeredTokenMatcher(m); } LayeredTokenPattern(String patternString); @Override String toString(); LayeredTokenMatcher matcher(LayeredSequence seq); Pattern getEncodedPattern(); }
LayeredTokenPattern { public LayeredTokenMatcher matcher(LayeredSequence seq) throws SequenceException { String encoded = encodeSequence(seq); Matcher m = encodedPattern.matcher(encoded); return new LayeredTokenMatcher(m); } LayeredTokenPattern(String patternString); @Override String toString(); LayeredTokenMatcher matcher(LayeredSequence seq); Pattern getEncodedPattern();  }