The LZ parsing [1]} of \(T[1,n]\)  is a sequence of non-empty phrases
(substrings) \(\mathit {LZ}(T) = (P_1,P_2,\ldots ,P_z)\)  such that \(T = P_1 P_2 \cdots P_z\) , built
as follows.
Assuming we have already parsed \(T[1,i-1]\) , producing \(P_1, P_2,\ldots ,P_{j-1}\) , then \(P_j\)  is set to the longest prefix of \(T[i,n]\)  that has a previous occurrence in \(T\)  that starts before position \(i\) .
Such a phrase \(P_j\)  is called a copying phrase, and its previous occurrence in \(T\)  is called the source of \(P_j\) .
When the longest prefix is of length zero, the next phrase is the single symbol \(P_j = T[i]\) , and \(P_j\)  is called a literal phrase.
This greedy parsing strategy yields the least number of phrases (see [1]}).
