private Substring getOffsets(BlockItem b) {
        if (b instanceof TermItem) {
            return b.getOrigin();
        } else if (b instanceof CompositeItem) {
            Item i = ((CompositeItem) b).getItem(0);
            if (i instanceof TermItem) {
                return ((TermItem) i).getOrigin(); // this should always be the case
            } else {
                getLogger().log(Level.WARNING, "BlockItem '" + b + "' was a composite containing " +
                                                  i.getClass().getName() + ", expected TermItem.");
            }
        }
        return null;
    }
Replaces query terms with their stems

@author Mathias Lidal
@author bratseth
@author Steinar Knutsen
container-search/src/main/java/com/yahoo/prelude/querytransform/StemmingSearcher.java