function [similar_words, S, j] = getsimilarwords(inputword, N, words)
%
% THIS IS NOT WHAT IS IMPLEMENTED:
% Path length
% A simple node-counting scheme (path). The relatedness score is inversely 
% proportional to the number of nodes along the shortest path between the synsets. 
% The shortest possible path occurs when the two synsets are the same, in which 
% case the length is 1. Thus, the maximum relatedness value is 1. 

load wordnet_ADE20K

if nargin<3
    % get list of words
    words = wn;
end

% get input branch
wordnet = wn(inputword);

if ~isempty(wordnet)
    % for each word get branches and compute intersection with the word_branch
    for i = 1:length(words)
        wnet_i = wn(words{i});
        
        if ~isempty(wnet_i)
            S(i) = sum(ismember(wnet_i.hypernym, wordnet.hypernym));
        else
            S(i) = 0;
        end
    end
    
    [~,j] = sort(S, 'descend');
    
    j = j(1:N+1);
    similar_words = words(j);
    S = S(j);
else
    similar_words = '';
    S = [];
end
