preDict’ive Text in Word
I expect that the most used piece of software (with, perhaps, the exception of Outlook) in any engineering firm is Microsoft Word. I’m sure anyone who knows me personally will understand why this is particularly distressing for me.
Although being able to auto-complete words based on usage is helpful, the most useful feature of preDict is it’s ability to guess the next word. After you’ve typed the first two or three words of a document preDict will begin to provide suggestions before you start.
One of my chief criticisms of winword (as it was once known) is that I have to do all the typing.
I know what you’re thinking: “Tom- that’s a little unfair, you can’t expect it to know what you’re thinking.” But it’s not. The likes of LibreOffice, Google, and even my phone can take a fairly reasonable swipe at what my future sentences might hold.
preDict has been a pet of mine for a few months now- slowly improving from a series of cowboy’esq patches to a soothsaying daemon with a “Palais des congrès de Montréal” aesthetic. Last week I finally got the source into a state that wouldn’t embarrass me in public, and released it into the wild. Now you, too, can enjoy reports that almost write themselves with this Word add-in.
Note: preDict might work on versions of Word before 2007, but I can’t guarantee it. If you do get it working, why not shift the code back up on GitHub?
Pride and preDict’ions
It’s always best to start with an example:
Not quite literary genius, but the above predictive text was written solely by typing two words and asking preDict to guess what word comes next until it got itself stuck in a loop. Considering it was all done without any human guidance- I think it turned out all right. Of course, you’re not meant just to blindly follow the predictions; but it’s a fun exercise to see what you talk about the most.
The Basics of Clairvoyance
Once you’ve got preDict loaded (see the end of the post) you’ll have this new and beautiful icon on your main menu bar.
Hit the button to start, and you’ll be welcomed with the main window. Due to some maddening restrictions by Microsoft, providing in-line predictive text within Word is simply impossible. After half a day of trying I was forced to yield to Occam’s razor and simply provide a new place for people to type.
To get going type in the white box; once you’ve completed (or auto-completed) a word preDict will ping it across to Word. The two other buttons are self-explanatory, I hope.
As you start to type a list of suggestions will develop on the right-hand-side. You can use the [UP] and [DOWN] arrow keys to navigate the list, and press [TAB] to use the selected (green) word. Continuing to type will narrow down the predictions, and pressing [SPACE] will send whatever you’ve typed back to Word, regardless of the predictions. This allows you to type normally, and only use the predictive functionality when you need it.
Although being able to auto-complete words based on usage is helpful, the most useful feature of preDict is it’s ability to guess the next word. After you’ve typed the first two or three words of a document preDict will begin to provide suggestions before you start. These predictions are mixed-in with the auto-complete functionality to help provide more relevant results, even once you’ve started typing.
Learning by Doing
preDict does not come with a pre-installed dictionary; it learns from you.
That means that the first time you start preDict, and every time it is exposed to a new document, it’ll offer to read it. If you want to fast-track your way to reasonable predictions I’d recommend opening a few old documents and letting it parse them.; it won’t take long. The more you use preDict the cleverer it will become.
As a guide, preDict read all 120’000-ish words of Pride and Prejudice in just under three minutes, and created a dictionary that took 30 seconds to load with no slow-down while predicting. I would not, however, recommend simply feeding it classic literature unless you really do write like Jane Austin.
Installation and Tweaks
Unlike the last piece of code I shared, preDict comes with an installation script. Just download preDict and run ‘setup.bat’. For the security conscious: all it does is copy the add-in file into your Word start-up directory. You might find that Word asks you to enable macros when you start, which can become a tad frustrating after the sixth time. You can lower your macro security settings- although in doing so you’ll have to promise Microsoft you won’t open any attachments from Nigerian millionaires who are (at the moment) down on their luck.
In addition to the setup, preDict also comes with it’s very own confusing dialog box. You could probably go the whole of your life without changing the majority of these options, however I would recommend you consider if words need to pass the spell check, which will reduce the potential for mistakes, but will also hinder the development of specialist vocabularies. You should also periodically hit the ‘guess’ button, which helps tune how much more important a matched phrase is compared to a frequently used word.
So if you feel like reducing the number of key-strokes you make in a day: