Example Programs with ETS
The examples in this section have to do with trigram generation. This is a nice “show-off” program that demonstrates the power of the ETS tables.
Our goal is to write a heuristic program that tries to predict whether a given string is an English word.
To predict whether a random sequence of letters is an English word, we’ll analyze which trigrams occur in the word. A trigram is a sequence of three letters. Now, not all sequences of three letters can occur in a valid English word. For example, there are no English words where the three-letter combinations akj and rwb occur. So, to test whether a string might be an English word, all we have to do is test all sequences of three consecutive letters in the string against ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access