@Test public void testMavenPOMAnalyzer() throws IOException { String input = "<project xmlns=\"http: + "xmlns:xsi=\"http: + "xsi:schemaLocation=\"http: + "http: + "<modelVersion>4.0.0</modelVersion>" + "<parent>\n" + "<groupId>name.abhijitsarkar.lucene</groupId>\n" + "<artifactId>lucene-learning</artifactId>\n" + "<version>1.0-SNAPSHOT</version>\n" + "</parent>\n" + "<artifactId>maven-repo-mgr</artifactId>\n" + "<packaging>jar</packaging>\n" + "<name>hadoop-examples</name>\n"; String[] output = new String[] { "name.abhijitsarkar.lucene", "lucene-learning" }; TokenStream stream = analyzer.tokenStream("field", new StringReader( input)); CharTermAttribute termAttr = stream .addAttribute(CharTermAttribute.class); OffsetAttribute offsetAtt = stream.addAttribute(OffsetAttribute.class); stream.reset(); Assert.assertTrue("There should be more tokens", stream.incrementToken()); Assert.assertEquals("Wrong token", output[0], termAttr.toString()); Assert.assertEquals("Wrong start offset", 0, offsetAtt.startOffset()); Assert.assertEquals("Wrong end offset", 34, offsetAtt.endOffset()); Assert.assertTrue("There should be more tokens", stream.incrementToken()); Assert.assertEquals("Wrong token", output[1], termAttr.toString()); Assert.assertEquals("Wrong start offset", 35, offsetAtt.startOffset()); Assert.assertEquals("Wrong end offset", 50, offsetAtt.endOffset()); Assert.assertFalse(stream.incrementToken()); stream.close(); }
public MavenPOMAnalyzer(Version matchVersion) { this(matchVersion, MAVEN_XML_TAG_SET); }
MavenPOMAnalyzer extends Analyzer { public MavenPOMAnalyzer(Version matchVersion) { this(matchVersion, MAVEN_XML_TAG_SET); } }
MavenPOMAnalyzer extends Analyzer { public MavenPOMAnalyzer(Version matchVersion) { this(matchVersion, MAVEN_XML_TAG_SET); } MavenPOMAnalyzer(Version matchVersion);  MavenPOMAnalyzer(Version matchVersion, String[] stopWords); }
MavenPOMAnalyzer extends Analyzer { public MavenPOMAnalyzer(Version matchVersion) { this(matchVersion, MAVEN_XML_TAG_SET); } MavenPOMAnalyzer(Version matchVersion);  MavenPOMAnalyzer(Version matchVersion, String[] stopWords);  }
MavenPOMAnalyzer extends Analyzer { public MavenPOMAnalyzer(Version matchVersion) { this(matchVersion, MAVEN_XML_TAG_SET); } MavenPOMAnalyzer(Version matchVersion);  MavenPOMAnalyzer(Version matchVersion, String[] stopWords);  static final String[] MAVEN_XML_TAG_SET; }