Hmmm, I'm having trouble walking through a string, testing different parts in a way that is both complete and tractable.
For example, say you're looking through vjkukurockovgzv, trying to count all of the words therein. Here's the order that I'm checking strings as words right now: v, vj, vjk, vjku, vjkuk, [...], j, jk, jku, jkuk, jkuku, [...], k, ku, kuk, kuku, [...]. That makes this problem an N! function (I think). One solution might be to add an extra function to the word lookup system that can tell that there is no word that begins with a particular string. That could bring the efficiency of the system much closer to N.