comparison scripts/ode/private/fuzzy_compare.m @ 20580:25623ef2ff4f

doc: Rewrite docstrings for ode* family of functions. * scripts/ode/module.mk: Remove extra newline. * ode45.m, odeget.m, odeset.m: Rewrite docstrings. * AbsRel_Norm.m, fuzzy_compare.m, hermite_quartic_interpolation.m, integrate_adaptive.m, integrate_const.m, integrate_n_steps.m, kahan.m, ode_struct_value_check.m, odepkg_event_handle.m, odepkg_structure_check.m, runge_kutta_45_dorpri.m, starting_stepsize.m: Don't break @deftypefn lines. Wrap lines at 80 columns rather than 72.
author Rik <rik@octave.org>
date Sat, 03 Oct 2015 21:03:16 -0700
parents fcb792acab9b
children eb9e2d187ed2
comparison
equal deleted inserted replaced
20579:52ce821a52fd 20580:25623ef2ff4f
14 ## 14 ##
15 ## You should have received a copy of the GNU General Public License 15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see 16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>. 17 ## <http://www.gnu.org/licenses/>.
18 18
19
20 ## -*- texinfo -*- 19 ## -*- texinfo -*-
21 ## @deftypefn {Command} {[@var{res}] =} fuzzy_compare @ 20 ## @deftypefn {Function File} {[@var{res}] =} fuzzy_compare (@var{"string1"}, @var{string_set}, [@var{correctness}])
22 ## (@var{"string1"}, @var{string_set}, [@var{correctness}])
23 ## 21 ##
24 ## Compare a string with a set of strings and returns the positions 22 ## Compare a string with a set of strings and returns the positions in the
25 ## in the set of strings at which there are the fields that best fit 23 ## set of strings at which there are the fields that best fit the one we are
26 ## the one we are comparing. 24 ## comparing.
27 ## 25 ##
28 ## The distance used to compare the words is the Levenshtein distance 26 ## The distance used to compare the words is the Levenshtein distance
29 ## and for more details see 27 ## and for more details see
30 ## @url{http://en.wikipedia.org/wiki/Levenshtein_distance}. 28 ## @url{http://en.wikipedia.org/wiki/Levenshtein_distance}.
31 ## 29 ##
32 ## This function must be called with one output argument @var{res} 30 ## This function must be called with one output argument @var{res} which
33 ## which contains the positions of the elements in @var{string_set} 31 ## contains the positions of the elements in @var{string_set} which best fit
34 ## which best fit the given word. The tolerance that is used to 32 ## the given word. The tolerance that is used to determine if a field of the
35 ## determine if a field of the list fits or not the given word is a 33 ## list fits or not the given word is a function of the length of the word
36 ## function of the length of the word and of the minimum distance of 34 ## and of the minimum distance of the word from all the elements of the list.
37 ## the word from all the elements of the list. The more the length, 35 ## The more the length, the more the tolerance. The less the minimum, the
38 ## the more the tolerance. The less the minimum, the less the 36 ## less the tolerance but if the minimum is close to the length of the word,
39 ## tolerance but if the minimum is close to the length of the word, 37 ## the tolerance must be small because it means that no field in the list is
40 ## the tolerance must be small because it means that no field in the 38 ## really fitting the given word. So that the function is:
41 ## list is really fitting the given word. So that the function is:
42 ## 39 ##
43 ## @ifhtml 40 ## @ifhtml
44 ## @example 41 ## @example
45 ## @math{tolerance = 2 * (length-minimum) * minimum / length} 42 ## @math{tolerance = 2 * (length-minimum) * minimum / length}
46 ## @end example 43 ## @end example
47 ## @end ifhtml 44 ## @end ifhtml
48 ## @ifnothtml 45 ## @ifnothtml
49 ## @math{tolerance = 2 * (length-minimum) * minimum / length}. 46 ## @math{tolerance = 2 * (length-minimum) * minimum / length}.
50 ## @end ifnothtml 47 ## @end ifnothtml
51 ## 48 ##
52 ## The first input argument must be a string containing the word to 49 ## The first input argument must be a string containing the word to compare.
53 ## compare.
54 ## 50 ##
55 ## The second input argument must be a vector of strings or a 51 ## The second input argument must be a vector of strings or a cell_array of
56 ## cell_array of strings and should contain the fields to use for the 52 ## strings and should contain the fields to use for the comparison.
57 ## comparison.
58 ## 53 ##
59 ## The third input argument is optional and represents a fixed 54 ## The third input argument is optional and represents a fixed tolerance that
60 ## tolerance that will replace the implemented one. 55 ## will replace the implemented one.
61 ## @end deftypefn 56 ## @end deftypefn
62 ## 57 ##
63 ## @seealso{odeset,odeget,levenshtein} 58 ## @seealso{odeset, odeget, levenshtein}
64 59
65 function res = fuzzy_compare (string1, string_set, correctness) 60 function res = fuzzy_compare (string1, string_set, correctness)
66 61
67 ## check on output arguments 62 ## check on output arguments
68 if (nargout > 1) 63 if (nargout > 1)