Autofill is usually done in one of the following ways:
- The trees . By indexing searchable text in a tree structure (prefix tree, suffix tree, dawg, etc.), you can perform a very fast search by storing memory. Tree traversal can be adapted for approximate matching.
- Separation of folders . Dividing the text into tokens (ngrams), you can search for instances of templates using a simple hashing scheme.
- Filtering . Find a set of potential matches, and then apply a consistent algorithm to test each candidate.
See completely , the Java autocomplete library that implements some of the latest concepts.
Miguel fonseca
source share