public void produce(RuleEvaluation e, int offset) {
        WordItem newItem = new WordItem(literal, getLabel(), true);
        if (replacing) {
            Match matched = e.getNonreferencedMatch(0);
            newItem.setWeight(matched.getItem().getWeight());
            insertMatch(e, matched, List.of(newItem), offset);
        }
        else {
            newItem.setWeight(getWeight());
            if (e.getTraceLevel() >= 6)
                e.trace(6, "Adding '" + newItem + "'");
            e.addItems(List.of(newItem), getTermType());
        }
    }
Returns the term word produced, never null
container-search/src/main/java/com/yahoo/prelude/semantics/rule/LiteralTermProduction.java