public boolean contains(SpanNode o) {
        int from = getFrom();
        int otherFrom = o.getFrom();
        int to = getTo();
        int otherTo = o.getTo();

        if (otherFrom >= from && otherTo <= to) {
            //other span node is within our range:
            return true;
        }
        return false;
    }
Checks if the text covered by another span is within the text covered by this span.

@param o the other SpanNode to check.
@return true if the text covered by another span is within the text covered by this span, false otherwise.
document/src/main/java/com/yahoo/document/annotation/SpanNode.java