package com.kryptnostic.api.v1.indexing.analysis;

import java.util.List;
import java.util.Map;

import org.junit.Assert;
import org.junit.Test;

import com.google.common.collect.Sets;

public class AnalyzerTests {
	private static final String doc = "This is a test document, with some fu(|<3d up $hit!";
	
	@Test
	public void testTokenizingWhitepsaceAnalyzer() {
		TokenizingWhitespaceAnalyzer analyzer = new TokenizingWhitespaceAnalyzer();
		
		Map<String,List<Integer>> invertedIndex = analyzer.analyze( doc );
		
		Assert.assertEquals(invertedIndex.keySet() , Sets.newHashSet( "This" , "is" , "a" , "test" , "document", "with", "some", "fu","3d", "hit", "up") );
	}
}

@@ -208,17 +208,20 @@
 Tests %7B%0A
-%09
+    
 private 
@@ -305,18 +305,23 @@
 !%22;%0A
-%09%0A%09
+%0A    
 @Test%0A
-%09
+    
 publ
@@ -365,18 +365,24 @@
 zer() %7B%0A
-%09%09
+        
 Tokenizi
@@ -449,21 +449,25 @@
 yzer();%0A
-%09%09%0A%09%09
+%0A        
 Map%3CStri
@@ -469,16 +469,17 @@
 %3CString,
+ 
 List%3CInt
@@ -530,13 +530,17 @@
  );%0A
-%09%09%0A%09%09
+%0A        
 Asse
@@ -555,16 +555,33 @@
 tEquals(
+%0A                
 inverted
@@ -594,18 +594,33 @@
 keySet()
- 
 ,
+%0A               
  Sets.ne
@@ -634,35 +634,32 @@
 t( %22
-T
+t
 his%22
- 
 , %22is%22
- 
 , %22a%22
- 
 , %22test%22
  , %22
@@ -654,17 +654,16 @@
 , %22test%22
- 
 , %22docum
@@ -689,16 +689,17 @@
 %22, %22fu%22,
+ 
 %223d%22, %22h
@@ -711,14 +711,18 @@
 %22up%22
+ 
 ) );%0A
-%09
+    
 %7D%0A%7D%0A

fix analyzer test failure due to capitalization