public void testKeep() throws Exception {
  CharacterRunAutomaton keepWords=new CharacterRunAutomaton(Operations.complement(Operations.union(Arrays.asList(Automata.makeString("foo"),Automata.makeString("bar"))),DEFAULT_MAX_DETERMINIZED_STATES));
  Analyzer a=new MockAnalyzer(random(),MockTokenizer.SIMPLE,true,keepWords);
  assertAnalyzesTo(a,"quick foo brown bar bar fox foo",new String[]{"foo","bar","bar","foo"},new int[]{2,2,1,2});
}

public void testKeep ( ) throws Exception { CharacterRunAutomaton keepWords = new CharacterRunAutomaton ( Operations . complement ( Operations . union ( Arrays . asList ( Automata . makeString ( "foo" ) , Automata . makeString ( "bar" ) ) ) , DEFAULT_MAX_DETERMINIZED_STATES ) ) ; Analyzer a = new MockAnalyzer ( random ( ) , MockTokenizer . SIMPLE , true , keepWords ) ; assertAnalyzesTo ( a , "quick foo brown bar bar fox foo" , new String [ ] { "foo" , "bar" , "bar" , "foo" } , new int [ ] { 2 , 2 , 1 , 2 } ) ; }
test a configuration that behaves a lot like keepwordfilter
