Definite String Completion dcp

An incremental suggestive lookup method

Tcl package dcp provides a procedure to get a prefix's completion list.
Incomplete strings and final strings are distinguished by a special character like ellipsis appended to one type.
Implementations provide definite completions to prefixes, that have been obtained by repeated lookup of completed prefixes.
Data structures that hold all recursively obtained prefixes are called Taipudex trie. Taipudex retrieval on arbitrary strings may require subsequent omission of the last character until a precomputed prefix is matched.
The initial set is the result of an empty string lookup.

The motivation is to support user interfaces with efficient completion.
Alternatives are easily selectable by the unique leading characters of each completion set. Selections, except the first, contain at least two choices.
Final strings, that itself are prefix of one or more elements, are made accessible by an added character like Tab, if this character is not part of any element in the set or at least not part of the current choice.

A Taipudex trie allows lookup of elements with minimal user interaction. The leading characters of each completion set are always different. Just one of the discriminating letters has to be typed and it gets appended to the current prefix together with the unique completion, if present and already displayed.
When displayed in a table layout, the current completion becomes the prefix in the left column, the second column shifts right and is filled with the next discriminating characters followed with their completions in the third column. An optional fourth column keeps additional informations of final elements, like the translation in dictionaries and/or hidden information like the index key of a related database table or an url.

Alas additional action is required to select the shorter strings, that itself occur as prefixes of one or more subsequent rows. This requires to press the key due to an auxiliary added suffix.
Common user interfaces always need to press an additional character, if the input is not validated with every keypress, like the final return or enter key to finish input or the sequence of down keys to get the intended element of an autosuggest listbox plus the final return or the tab-space or tab-return sequence to push the button.
Some implementations of non-statistically based autosuggest menus simply cut off the list after the first few matches for performance reasons, and thus don't provide useful support to the user's selection process. A Taipudex trie's completion sets are small in size and offer all branches at a glance - except the first, that gets the size of the used alphabet with natural languages.

Simple size reduction is possible by restriction to lowercase letters. An all lowercase Taipudex trie does without the shift key and optionally checks with toggled case on mismatch. Typos on input are noticed early, as the current selection does not advance.

Taipudex lookup is not restricted to single words.
Leading unique abbreviations are possible to realise a lookup by categories in a single user interface. As for example a leading space could intentionally be used to introduce a separate path to names. Also leading punctuation characters in expert versions could provide a dedicated selection process.
As the arrangement of discriminating keys displays a dynamic virtual keyboard, comparable to a soft keyboard with unused characters eliminated, this method combined with appropriate animation and an undo element added in each branch, will enable one key or one button controls.


Demo dictionary, implemented as dynamic menu.

Δdatentechnik software