Next: , Previous: Top, Up: Top


1 What is predictive completion?

The languages we use to communicate contain a large amount of redundancy. Given the first few letters of a word, for instance, it's not too difficult to predict what should come next. Try it! You can probably easily guess how to fill in the missing letters in the following sentence:

     Giv th fir fe lett o a wor i no diffi t predi wh shou com nex.

This is even more true of the languages used to communicate with computers, which typically have very restricted vocabularies and rigidly defined grammars. Redundancy occurs on many levels: on the level of individual characters (as illustrated above), on the level of words (we can often predict quite accurately what words are likely to come next in a sentence, based on grammar and usage), and perhaps even on higher levels. Predictive completion exploits this redundancy by attempting to complete what you are trying to type before you've finished typing it.

The predictive completion package described here is an add-on to the GNU Emacs editor, which implements a new minor-mode called predictive-mode (see Minor Modes). When this predictive completion minor-mode is switched on, Emacs will try to complete the word you are typing based on the characters typed so far. As you add characters, it can look up words starting with those characters in a dictionary, and offer to insert the most likely ones. How you choose which completion (if any) to insert depends on various customization settings, some more intrusive than others.

Note that by only taking into account characters belonging to the current word when predicting how to complete it, much of the redundancy in language remains unexploited. This limitation is partly for simplicity, but also because some of the benefits of predictive completion would be lost if context (i.e. the preceding words and sentences) was also taken into account.

What benefits does predictive completion bring?

  1. Saving on typing (obviously!): you don't have to type the whole word.
  2. Automatic spelling assistance: when you type the first few characters of a word, only correct spellings of the whole word are offered. This is not only useful for human languages. The predictive completion mode can be set up to complete on variable and function names in a program, helping avoid bugs due to misspelled names.
  3. Faster typing (possibly): not quite the same as point 1. As you get used to predictive completion, your fingers will start to learn the key sequences required for frequently used words. And these key sequences will usually be much shorter than typing the full word. (This is one reason for not taking context into account. If we did, the same word might require different key sequences depending on the words and sentences preceding it.)

Whether predictive mode really speeds up typing or not is debatable. At the very least it depends on the context in which predictive mode is used. Although you have to type less, you have to process more information as you type, to decide whether to accept the offered completion or whether to add more characters to narrow down the completions to word you want. And this increased “cognitive load” might wipe out the advantage of having to type fewer characters. Studies indicate that the cognitive does increase, but whether or not this negates all speed advantage to predictive completion systems is less clear. It seems plausible that the more you use predictive mode, the better you will become at quickly evaluating the possible completions. Also, with the default settings, there is nothing to stop you typing normally and ignoring the completions entirely until you want to make use of them. In the end, the only way to find out is to try it and see!