The goog.ui.ac.ArrayMatcher Class

goog.ui.ac.ArrayMatcher(rows, opt_noSimilar)

Basic class for matching words in an array

rows {Array}
Dictionary of items to match. Can be objects if they have a toString method that returns the value to match against.
opt_noSimilar {boolean=}
if true, do not do similarity matches for the input token against the dictionary.

.getPrefixMatches(token, maxMatches)

Matches the token against the start of words in the row.

token {string}
Token to match.
maxMatches {number}
Max number of matches to return.
returns {Array}
Rows that match.

.getSimilarRows(token, maxMatches)

Matches the token against similar rows, by calculating "distance" between the terms.

token {string}
Token to match.
maxMatches {number}
Max number of matches to return.
returns {Array}
The best maxMatches rows.

.requestMatchingRows(token, maxMatches, matchHandler, opt_fullString)

Function used to pass matches to the autocomplete

token {string}
Token to match.
maxMatches {number}
Max number of matches to return.
matchHandler {Function}
callback to execute after matching.
opt_fullString {string=}
The full string from the input box.

.setRows(rows)

Replaces the rows that this object searches over.

rows {Array}
Dictionary of items to match.