private static WordItem findOrigWordItem(Item root, String value) {
        Deque<Item> stack = new ArrayDeque<>();
        stack.push(root);
        while (!stack.isEmpty()) {
            Item item = stack.pop();
            if (! item.isFilter() && item instanceof WordItem word && word.getWord().equals(value))
                return word;
            if (item instanceof CompositeItem lst) {
                for (Iterator<Item> it = lst.getItemIterator(); it.hasNext();) {
                    stack.push(it.next());
                }
            }
        }
        return null;
    }
Returns the first word item contained in the given item tree that is an instance of {@link WordItem} with the
given word value.

@param root the root of the tree to check
@param value the word to look for
@return the first node found
container-search/src/main/java/com/yahoo/prelude/querytransform/RecallSearcher.java