package querqy.rewrite.contrib;

import querqy.model.ExpandedQuery;
import querqy.rewrite.QueryRewriter;
import querqy.rewrite.RewriterFactory;

import java.util.Map;

/**
 * Factory for {@link ShingleRewriter}
 */
public class ShingleRewriterFactory implements RewriterFactory {
    private boolean acceptGeneratedTerms;

    public ShingleRewriterFactory(boolean acceptGeneratedTerms){
        this.acceptGeneratedTerms = acceptGeneratedTerms;
    }

    @Override
    public QueryRewriter createRewriter(ExpandedQuery input, Map<String, ?> context) {
        return new ShingleRewriter(acceptGeneratedTerms);
    }

}

@@ -316,16 +316,103 @@
 Terms;%0A%0A
+    public ShingleRewriterFactory()%7B%0A        this.acceptGeneratedTerms = false;%0A    %7D%0A%0A
     publ

Add default constructor to ShingleRewriterFactory