code: public boolean isAncestor(GrammaticalRelation gr) {
      while (gr != null) {
        // Changed this test from this == gr (mrsmith)
        if (this.equals(gr)) { return true; }
        gr = gr.parent;
      }
      return false;
    }
docs: Returns whether this is equal to or an ancestor of gr in the grammatical relations hierarchy.