Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Test project.
branch: master

This branch is 9 commits behind inetis:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
demo
src
BSDmakefile
README.md
cities.txt

README.md

Autocomplete (word completeion) function predicts word user intended to type in the search box.

Autocomplete takes a dictionary of weighted words and produces a list of suggestions for user's query.

The results on cities database:

query       suggestions
-----------------------------------------------------------------------------------------
Lis Agne    Los Angeles, Los Angelitos, Les Agnels, Les Agneliers, Les Agneliers Bas
nw yr       New York, Nwoya, Nweyon, Na Yan, Nwarem
cpenh       Copenhagen, Cepni, Spencer, Cienega, Cuenha
-----------------------------------------------------------------------------------------

Autocomplete is implemented in C++. Use it as follows:

TAutocomplete ac;
ac.load("cities.txt");                 // load dictionary once
vector<string> suggestions;            // autocomplete suggestions

ac.autocomplete("cpenh", suggestions); // find suggestions for input
                                       // query "cpenh"; max number
                                       // of sugegstions (default 5)
                                       // can be set as the last
                                       // parameter of the method`

See also: http://blog.inetis.com/improved-autocomplete-function-for-google-maps

Something went wrong with that request. Please try again.