%% Find Nearest Words
% Create an edit distance searcher.

vocabulary = ["Text" "Analytics" "Toolbox"];
eds = editDistanceSearcher(vocabulary,2);

% Find the nearest words to "Test" and "Analysis".

words = ["Test" "Analysis"];
idx = knnsearch(eds,words)

% Get the words from the vocabulary using the returned indices.

nearestWords = eds.Vocabulary(idx)

% Copyright 2018 The MathWorks, Inc.