[ Home > Softwares > xvkbd ]

xvkbd - making your own completion dictionary

xvkbd 2.1 and later support word completion using a dictionary, simple list of words to be completed.

At least for English, most systems must have such dictionary (probably for spell(1), look(1), etc.) already installed. But you may think that the file contains too many words, and want to remove unnecessary words to make it easier to selecting from the displayed list.

Following script will extract words which are at least five characters, appeared more than four times in the files under your home directory, and appeared also in the /usr/dict/words file.

  find $HOME -type f -exec cat {} \; |
    tr -cs 'A-Za-z' '\012' |
    grep '.....' |
    sort -f |
    uniq -c |
    gawk '4 < $1 { print $2 }' |
    comm -12 - /usr/dict/words > $HOME/xvkbd.dic

Then, you can invoke xvkbd as ``xvkbd -dict $HOME/xvkbd.dic'' to use the file created above as the completion dictionary. Instead of the -dict option, you can use ``xvkbd.dictFile'' resource, too.


by Tom Sato, 2002-02-15