public KeyValueNode<String,Integer> findWord(String aWord){
  aWord=aWord.toLowerCase();
  KeyValueNode<String,Integer> parent=root;
  int depth=1;
  while (parent.hasChildren()) {
    String w=aWord.substring(0,depth);
    KeyValueNode<String,Integer> child=parent.getChild(w);
    if (w.equals(aWord)) {
      return child;
    }
 else     if (child != null) {
      parent=child;
      depth++;
    }
 else {
      return null;
    }
  }
  return null;
}

public KeyValueNode < String , Integer > findWord ( String aWord ) { aWord = aWord . toLowerCase ( ) ; KeyValueNode < String , Integer > parent = root ; int depth = 1 ; while ( parent . hasChildren ( ) ) { String w = aWord . substring ( 0 , depth ) ; KeyValueNode < String , Integer > child = parent . getChild ( w ) ; if ( w . equals ( aWord ) ) { return child ; } else if ( child != null ) { parent = child ; depth ++ ; } else { return null ; } } return null ; }
finds a node with a given string . if not found null is returned .
