private TaggableItem segment(String field, OperatorNode<ExpressionOperator> ast, String wordData,
                                 boolean fromQuery, Class<?> parent, Language language) {
        String toSegment = wordData;
        Substring s = getOrigin(ast);
        Language usedLanguage = language == null ? currentlyParsing.getLanguage() : language;
        if (s != null) {
            toSegment = s.getValue();
        }
        List<String> words = segmenter.segment(toSegment, usedLanguage);

        TaggableItem wordItem;
        if (words.isEmpty()) {
            wordItem = new WordItem(wordData, fromQuery);
        } else if (words.size() == 1 || !phraseArgumentSupported(parent)) {
            wordItem = new WordItem(words.get(0), fromQuery);
        } else {
            wordItem = new PhraseSegmentItem(toSegment, fromQuery, false);
            ((PhraseSegmentItem) wordItem).setIndexName(field);
            for (String w : words) {
                WordItem segment = new WordItem(w, fromQuery);
                prepareWord(field, ast, segment);
                ((PhraseSegmentItem) wordItem).addItem(segment);
            }
            ((PhraseSegmentItem) wordItem).lock();
        }
        return wordItem;
    }
Converts the payload of a contains statement into an Item

@param exactMatch true to always create an ExactStringItem, false to never do so, and null to
                  make the choice based on the field settings
container-search/src/main/java/com/yahoo/search/yql/YqlParser.java