# HG changeset patch # User Carlo de Falco # Date 1417690299 -3600 # Thu Dec 04 11:51:39 2014 +0100 # Node ID 0d67f39ac39dc6be9e5535c4840426afcbf2ec18 # Parent 40f86e8c072f512b00a8f9f341f907bc227174f1 Change comments to imperative mood. * fuzzy_compare: change mood in comments. diff --git a/inst/string_compare/fuzzy_compare.m b/inst/string_compare/fuzzy_compare.m --- a/inst/string_compare/fuzzy_compare.m +++ b/inst/string_compare/fuzzy_compare.m @@ -99,22 +99,22 @@ res = []; - ## defining the length of the given word and + ## define the length of the given word and ## the number of fields in the list m = length (string1); fields_nb = size (string_set, 1); - ## initializing the vector that will contain the distances + ## initialize the vector that will contain the distances values = inf .* ones (fields_nb, 1); - ## removing spaces from the end of the given string + ## removie spaces from the end of the given string string1 = deblank (string1); string2 = []; minimus = inf; ## loop on every field of the list for i = 1:fields_nb - ## removing spaces at the end + ## remove spaces at the end if (iscellstr (string_set)) string2 = deblank (string_set{i}); else @@ -128,7 +128,7 @@ minimus = min (minimus, values(i)); endfor - ## finding out the positions with the minimal distance + ## find out the positions with the minimal distance positions = find (values == minimus); if (minimus == 0) # exact match @@ -141,7 +141,7 @@ return endif - ## determining the tolerance with the formula described in the + ## determine the tolerance with the formula described in the ## textinfo section it is a downwards parable with zeros in 0 and m ## and with a maximum in m/2 of value m/2 tolerance = m * (-(minimus - m) * minimus * (2 / (m*m))); @@ -163,7 +163,7 @@ endif endif - ## returning the positions of the fields whose distance is lower + ## return the positions of the fields whose distance is lower ## than the tolerance for i = 1:1:fields_nb if (values(i) <= tolerance)