private void replace(List<PhraseMatcher.Phrase> phrases) {
        // Replacing the leaf replace phrases first to preserve
        // the start index of each replace phrase until replacement
        for (int i = phrases.size()-1; i >= 0; i--) {
            PhraseMatcher.Phrase phrase = phrases.get(i);
            if (phrase.getLength() > 1)
                phrase.replace();
        }
    }
Replaces all phrases longer than one word with a PhraseItem
container-search/src/main/java/com/yahoo/prelude/querytransform/PhrasingSearcher.java