private Node searchNode(final NodeArray children,final CharSequence word,final int offset,final int length){
  final int count=children.length;
  char currentChar=word.charAt(offset);
  for (int j=0; j < count; j++) {
    final Node node=children.data[j];
    if (node.code == currentChar) {
      if (offset == length - 1) {
        if (node.terminal) {
          return node;
        }
      }
 else {
        if (node.children != null) {
          Node returnNode=searchNode(node.children,word,offset + 1,length);
          if (returnNode != null)           return returnNode;
        }
      }
    }
  }
  return null;
}

private Node searchNode ( final NodeArray children , final CharSequence word , final int offset , final int length ) { final int count = children . length ; char currentChar = word . charAt ( offset ) ; for ( int j = 0 ; j < count ; j ++ ) { final Node node = children . data [ j ] ; if ( node . code == currentChar ) { if ( offset == length - 1 ) { if ( node . terminal ) { return node ; } } else { if ( node . children != null ) { Node returnNode = searchNode ( node . children , word , offset + 1 , length ) ; if ( returnNode != null ) return returnNode ; } } } } return null ; }
search for the terminal node of the word
