Sujet : Re: (Long post) Metaphone Algorithm In AWK
De : porkchop (at) *nospam* invalid.foo (Mike Sanders)
Groupes : comp.lang.awkDate : 19. Aug 2024, 05:34:26
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v9ui0i$2nq9o$2@dont-email.me>
References : 1 2 3
User-Agent : tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Mike Sanders <
porkchop@invalid.foo> wrote:
# Metaphone Algorithm in AWK v2: Michael Sanders - 2024
[...]
# entry point...
{
for (x = 1; x <= NF; x++) {
if (similarity(metaphone($x, 10), find_code) >= 80)
print find " : " $x
}
}
# entry point...
#
# match is considered true when:
# similarity is at least 80%
# distance is 3 or less
# phonetic encoding is equal
#
#
https://tilores.io/metaphone-phonetic-algorithm-online-tool{
for (x = 1; x <= NF; x++) {
word_code = metaphone($x, 10)
dist = levenshtein($x, find)
psim = similarity($x, find)
if (psim >= 80 && dist <= 3 && word_code == find_code)
print find " : " $x
}
}
-- :wqMike Sanders