--- TypeTokenFilter.java	2012-02-01 11:18:40.070981308 +0100
+++ TypeTokenFilter.java.bnb	2012-02-01 11:20:42.982984113 +0100
@@ -17,10 +17,11 @@
  * limitations under the License.
  */
 
-import org.apache.lucene.analysis.tokenattributes.TypeAttribute;
-
 import java.io.IOException;
 import java.util.Set;
+import org.apache.lucene.analysis.FilteringTokenFilter;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.analysis.tokenattributes.TypeAttribute;
 
 /**
  * Removes tokens whose types appear in a set of blocked types from a token stream.
@@ -29,10 +30,16 @@
 
   private final Set<String> stopTypes;
   private final TypeAttribute typeAttribute = addAttribute(TypeAttribute.class);
+  private final boolean useWhitelist;
 
   public TypeTokenFilter(boolean enablePositionIncrements, TokenStream input, Set<String> stopTypes) {
+      this(enablePositionIncrements, input, stopTypes, false);
+  }
+  
+  public TypeTokenFilter(boolean enablePositionIncrements, TokenStream input, Set<String> stopTypes, boolean useWhitelist) {
     super(enablePositionIncrements, input);
     this.stopTypes = stopTypes;
+    this.useWhitelist = useWhitelist;
   }
 
   /**
@@ -40,6 +47,10 @@
    */
   @Override
   protected boolean accept() throws IOException {
-    return !stopTypes.contains(typeAttribute.type());
+    if (useWhitelist) {
+      return stopTypes.contains(typeAttribute.type());
+    } else {
+      return !stopTypes.contains(typeAttribute.type());
+    }
   }
 }
