Operation of comparison, which is named as "rough equality" and is designated "≈", can be applied to strings. It returns natural value, equal to deviation of two strings, or "null", if two strings are not equal.
Following differences can exist between words: superfluous letter, missed letter, other letter (i.e. one letter is replaced by other letter). Differences "upper-case letter" - "lower-case letter", "abbreviation" - "word from lower-case letters" are considered as difference "missed letter" (as presence-absence of one of two control marks, creating capital letter and abbreviation). Each difference is estimated in 1 points (because irrelevance [look below] accepts values in range from zero to three). Such set of differences is chosen of all variants, at which sum of points is minimal - this minimal sum is named as incongruity. Words are not rough-equal at detection more than 3 differences "other letter".
Following differences can exist between phrases: superfluous word, missed word, permutation of two words, other word (i.e. one word is replaced by other word), convolution (of words, going consecutively, into an abbreviation from initial letters of each word). Each difference is estimated in 16 points (for convolution - in 16 points on each letter of an abbreviation). It try to disassemble difference "other word" as set of differences between pair of words to reduce quantity of points (if two words are not equal, then difference "other word" is counted). Blank between words can be excluded or is replaced by hyphen - Both transformation is estimated in 1 point. Such set of differences is chosen of all variants, at which sum of points is minimal - this minimal sum is named as deviation.
Output records are sorted and extracted in order of increasing of deviation and incongruity.
P.S.
It's possible to assign value of this sum into a fields of a table.