Computes the LCP array in O(n) based on the input string & its suffix array.

        Kasai et al. (2001).

def _compute_lcptab(self, string, suftab):
        """Computes the LCP array in O(n) based on the input string & its suffix array.

        Kasai et al. (2001).
        """
        n = len(suftab)
        rank = [0] * n
        for i in xrange(n):
            rank[suftab[i]] = i
        lcptab = np.zeros(n, dtype=np.int)
        h = 0
        for i in xrange(n):
            if rank[i] >= 1:
                j = suftab[rank[i] - 1]
                while string[i + h] == string[j + h]:
                    h += 1
                lcptab[rank[i]] = h
                if h > 0:
                    h -= 1
        return lcptab