by jnellis · 7y ago · 0 comments
https://ptgmedia.pearsoncmg.com/images/9780201615869/samplep...
One thing I've noticed from playing with these types of programs is the number of words to use as a hash. Two to start with of course, will quickly reproduce the sample text once you get to only five or six prefix words. Where as two prefix words usually generate nonsense, the sweet spot to a believable quality is only three or four words as a prefix with five or more reproducing the original text. The larger the varied sample text, the much better the results. Furthermore, only breaking words on whitespace creates even better quality output than assuming you need to tinker with the punctuation.
See also https://en.wikipedia.org/wiki/Google_Ngram_Viewer which recently popularized the term n-gram.
Eh? It's well known in Info Retrieval; it goes back at least to Salton's IR group at Cornell in the 1970's.