public static String getRewriteFromFSA(Query query,
                                           HashMap<String, Object> rewriterDicts,
                                           String dictName,
                                           String key) throws RuntimeException {
        if(rewriterDicts==null) {
            error(utilsLogger, query, "HashMap containing rewriter dicts is null");
            throw new RuntimeException("HashMap containing rewriter dicts is null");
        }

        FSA fsa = (FSA)rewriterDicts.get(dictName);

        if(fsa==null) {
            error(utilsLogger, query, "Error retrieving FSA dictionary: " + dictName);
            throw new RuntimeException("Error retrieving FSA dictionary: " + dictName);
        }

        String result = null;
        result = fsa.lookup(key);
        log(utilsLogger, query, "Retrieved rewrite: " + result);

        return result;
    }
Retrieve rewrite from FSA given the original query

@param query Query object from searcher
@param dictName FSA dictionary name
@param rewriterDicts list of rewriter dictionaries
                     It has the following format:
                     HashMap&lt;dictionary name, FSA&gt;
@param key The original query used to retrieve rewrite
           from the dictionary
@return String The retrieved rewrites, null if query
        doesn't exist
container-search/src/main/java/com/yahoo/search/query/rewrite/RewriterUtils.java