({{, (RefLink[AutocompletionFunction, paclet:ref/AutocompletionFunction])[…] 
represents a function to be applied to a string to generate possible completions. }})

OpenersNotesSection(Spacer1)Details

(RefLink[AutocompletionFunction, paclet:ref/AutocompletionFunction]) works like (RefLink[Function, paclet:ref/Function]).

(RefLink[AutocompletionFunction, paclet:ref/AutocompletionFunction])[…] is generated by (RefLink[Autocomplete, paclet:ref/Autocomplete])[comps].

(RefLink[AutocompletionFunction, paclet:ref/AutocompletionFunction])[…]["string"] yields a list of completions of string.

OpenersPrimaryExamplesSection(Spacer1)Examples  (2)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Create an (RefLink[AutocompletionFunction, paclet:ref/AutocompletionFunction]) with (RefLink[Autocomplete, paclet:ref/Autocomplete]) and a list of words:

auto=Autocomplete[{"house", "housing", "airplane"}]

Complete the string:

auto["hou"]

Limit the number of results:

auto["hou", 1]

Give additional metadata to (RefLink[Autocomplete, paclet:ref/Autocomplete]):

auto2 = Autocomplete[{<|"String"->"house","Weight"->20|>,<|"String"->"housing","Weight"->30, "Result"-> "Housing"|>}]

auto2["hou", 1]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Autocomplete, paclet:ref/Autocomplete])  ▪  (RefLink[NearestFunction, paclet:ref/NearestFunction])}})}})