@@ -0,0 +1,1253 @@
+package de.ids_mannheim.korap.index;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.junit.Assert.fail;%0A%0Aimport java.io.StringReader;%0Aimport java.io.IOException;%0A%0Aimport de.ids_mannheim.korap.index.KeywordAnalyzer;%0Aimport org.apache.lucene.analysis.TokenStream;%0Aimport org.apache.lucene.analysis.tokenattributes.CharTermAttribute;%0A%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.JUnit4;%0A%0A%0A@RunWith(JUnit4.class)%0Apublic class TestKeywordAnalyzer %7B%0A%0A%09@Test%0A%09public void keywordAnalyzer () throws IOException %7B%0A%0A%09%09StringReader reader = new StringReader(%22alpha beta gamma%22);%0A%09%09%0A%09%09KeywordAnalyzer kwa = new KeywordAnalyzer();%0A%09%09TokenStream ts = kwa.tokenStream(%22keys%22, reader);%0A%09%09ts.reset();%0A%0A%09%09assertTrue(ts.incrementToken());%0A%09%09CharTermAttribute term = ts.getAttribute(CharTermAttribute.class);%0A%0A%09%09assertEquals(term.toString(), %22alpha%22);%0A%09%09assertTrue(ts.incrementToken());%0A%09%09term = ts.getAttribute(CharTermAttribute.class);%0A%09%09assertEquals(term.toString(), %22beta%22);%0A%0A%09%09assertTrue(ts.incrementToken());%0A%09%09term = ts.getAttribute(CharTermAttribute.class);%0A%09%09assertEquals(term.toString(), %22gamma%22);%0A%0A%09%09assertTrue(!ts.incrementToken());%0A%09%7D;%0A%7D;%0A

Test KeywordAnalyzer