Patent ID: 7409637

Claim:
A computer-implemented method of processing text, the method comprising: providing a unit of text to a text buffer; dividing the unit of text into one or more shift blocks and one or more replacement blocks; based on a replacement operation of replacing each replacement block with replacement text, determining a final position of each shift block within the text buffer; and determining a schedule for the replacement operation based at least in part on the final position of each shift block, wherein determining a schedule for the replacement operation further comprises: determining, in the unit of text, a left-most shift block Su[mu,nu] that has not been processed and where nu′<nu, wherein each shift block S 1 , . . . , Sp are subparts t[n 1 +1,m 2 −1], . . . t[np+1,N−1] of the unit of text t; shifting each shift block and replacing each replacement block preceding the first shift block Su in the text buffer, from right to left, skipping already processed blocks; and repeating the determining and shifting until no further Su is determined.