private List<FieldPart> translate(String toQuote, QuoteTable translations, boolean isToken) {
        List<FieldPart> newFieldParts = null;
        int lastIdx = 0;
        for (int i = 0; i < toQuote.length(); i++) {
            String quote = translations.get(toQuote.charAt(i));
            if (quote != null) {
                if (newFieldParts == null)
                    newFieldParts = new ArrayList<>();
                if (lastIdx != i)
                    newFieldParts.add(new StringFieldPart(toQuote.substring(lastIdx, i), isToken));
                String initContent = Character.toString(toQuote.charAt(i));
                newFieldParts.add(new ImmutableFieldPart(initContent, quote, isToken));
                lastIdx = i+1;
            }
        }
        if (lastIdx > 0 && lastIdx < toQuote.length())
            newFieldParts.add(new StringFieldPart(toQuote.substring(lastIdx), isToken));
        return newFieldParts;
    }
A searcher which does quoting based on a quoting table.

May be extended to do quoting template sensitive.

@author Steinar Knutsen
container-search/src/main/java/com/yahoo/prelude/searcher/QuotingSearcher.java