@@ -0,0 +1,1861 @@
+package de.tblsoft.solr.pipeline.filter;%0A%0A%0Aimport de.tblsoft.solr.pipeline.AbstractFilter;%0Aimport de.tblsoft.solr.pipeline.bean.Document;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A%0A%0Apublic class FuzzyPermutationFilter extends AbstractFilter %7B%0A%0A%0A%0A    private String input;%0A%0A    private int distance;%0A    private String output;%0A%0A%0A    @Override%0A    public void init() %7B%0A%0A%0A        input = getProperty(%22input%22, %22token%22);%0A        output = getProperty(%22output%22, %22permutations%22);%0A        distance = getPropertyAsInt(%22distance%22, 2);%0A%0A%0A        super.init();%0A    %7D%0A%0A%0A    @Override%0A    public void document(Document document) %7B%0A        if(document.getFieldValues(input) == null) %7B%0A            super.document(document);%0A            return;%0A        %7D%0A        Set%3CString%3E permutations = new HashSet%3CString%3E();%0A        for(String value : document.getFieldValues(input)) %7B%0A            permutations.addAll(permutate(value, distance));%0A        %7D%0A        document.addField(output, new ArrayList%3CString%3E(permutations));%0A        super.document(document);%0A    %7D%0A%0A    private Set%3CString%3E permutate(String word, int iterations) %7B%0A        Set%3CString%3E ret = new HashSet%3CString%3E();%0A        ret.add(word);%0A        if(iterations %3C= 0) %7B%0A            return ret;%0A        %7D%0A        Set%3CString%3E permutations = permutate(word);%0A        int newIteration = --iterations;%0A        for(String permutation: permutations) %7B%0A            ret.addAll(permutate(permutation, newIteration));%0A        %7D%0A%0A        ret.addAll(permutations);%0A%0A        return ret;%0A    %7D%0A%0A    private Set%3CString%3E permutate(String word) %7B%0A        Set%3CString%3E ret = new HashSet%3CString%3E();%0A        for (int i = 0; i %3C word.length(); i++) %7B%0A            StringBuilder builder = new StringBuilder(word);%0A            ret.add(builder.deleteCharAt(i).toString());%0A        %7D%0A%0A        return ret;%0A%0A    %7D%0A%0A%0A%7D%0A%0A

implement a fuzzy permutation filter