def __search(self, curr_node, wLst):
        '''Search the tree and identify the position for inserting the suffix'''

        if len(wLst) == 1:
            print 'Empty suffix- no valid suffix tree found for the input'
            sys.exit(1)

        # @type curr_node SimpleSuffixTree
        ptr = 0
        while True:
            new_label = wLst[ptr]
            if curr_node.__childIndxDict.has_key(new_label):
                child_node = curr_node.__childIndxDict[new_label]
                ptr += 1
                curr_node = child_node
                if len(wLst) == 0:
                    break
            else:
                break

        return (ptr, curr_node)
dataset/ETHPy150Open sfu-natlang/Kriya/src/Kriya-Grammar-Xtrctr/myTrie1.py/SuffixTreeNode.__search/original