This algorithm can be implemented directly and functions as expected on synthetic examples, but would need modification to run efficiently on natural languages.
rather than considering whole contexts of the form (l, r) it would be natural to restrict them just to a narrow window of one or two words or tags on each side.