@Test public void analyzerByComposition_FileResource() throws Exception{ NodeBuilder nb = EMPTY_NODE.builder(); nb.child(ANL_TOKENIZER).setProperty(ANL_NAME, "whitespace"); NodeBuilder filters = nb.child(ANL_FILTERS); NodeBuilder stop = filters.child("stop"); stop.setProperty("words", "set1.txt, set2.txt"); createFileNode(stop, "set1.txt", newCharArraySet("foo", "bar")); createFileNode(stop, "set2.txt", newCharArraySet("foo1", "bar1")); TokenizerChain analyzer = (TokenizerChain) factory.createInstance(nb.getNodeState()); assertEquals(1, analyzer.getFilters().length); assertEquals(StopFilterFactory.class.getName(), analyzer.getFilters()[0].getClassArg()); StopFilterFactory sff = (StopFilterFactory) analyzer.getFilters()[0]; assertTrue(sff.getStopWords().contains("foo")); assertTrue(sff.getStopWords().contains("foo1")); }
public Analyzer createInstance(NodeState state) { if (state.hasProperty(LuceneIndexConstants.ANL_CLASS)){ return createAnalyzerViaReflection(state); } return composeAnalyzer(state); }
NodeStateAnalyzerFactory { public Analyzer createInstance(NodeState state) { if (state.hasProperty(LuceneIndexConstants.ANL_CLASS)){ return createAnalyzerViaReflection(state); } return composeAnalyzer(state); } }
NodeStateAnalyzerFactory { public Analyzer createInstance(NodeState state) { if (state.hasProperty(LuceneIndexConstants.ANL_CLASS)){ return createAnalyzerViaReflection(state); } return composeAnalyzer(state); } NodeStateAnalyzerFactory(Version defaultVersion);   NodeStateAnalyzerFactory(ResourceLoader defaultLoader, Version defaultVersion); }
NodeStateAnalyzerFactory { public Analyzer createInstance(NodeState state) { if (state.hasProperty(LuceneIndexConstants.ANL_CLASS)){ return createAnalyzerViaReflection(state); } return composeAnalyzer(state); } NodeStateAnalyzerFactory(Version defaultVersion);   NodeStateAnalyzerFactory(ResourceLoader defaultLoader, Version defaultVersion); Analyzer createInstance(NodeState state); }
NodeStateAnalyzerFactory { public Analyzer createInstance(NodeState state) { if (state.hasProperty(LuceneIndexConstants.ANL_CLASS)){ return createAnalyzerViaReflection(state); } return composeAnalyzer(state); } NodeStateAnalyzerFactory(Version defaultVersion);   NodeStateAnalyzerFactory(ResourceLoader defaultLoader, Version defaultVersion); Analyzer createInstance(NodeState state);  }