This is exactly how Dasher works, except for one crucial point:
we alter the SIZE of the shelf space devoted to each
book in proportion to the probability of the
For example, not very many books start with an "x", so we devote
less space to "x..." books, and more to the
more plausible books, thus making it easier to find
books that contain probable text.
Here is the corresponding sequence of pictures
of the library in Dasher. (The character "_" denotes the space character.)
Dasher can be trained on examples of any writing style,
and it learns all the time, picking up your personal
turns of phrase.