Re: (Long post) Metaphone Algorithm In AWK

Liste des GroupesRevenir à cl awk 
Sujet : Re: (Long post) Metaphone Algorithm In AWK
De : porkchop (at) *nospam* invalid.foo (Mike Sanders)
Groupes : comp.lang.awk
Date : 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
  }
}

--
:wq
Mike Sanders


Date Sujet#  Auteur
17 Aug 24 * (Long post) Metaphone Algorithm In AWK17Mike Sanders
19 Aug 24 +* Re: (Long post) Metaphone Algorithm In AWK10Ben Bacarisse
19 Aug 24 i+- Re: (Long post) Metaphone Algorithm In AWK1Ben Bacarisse
19 Aug 24 i+* Re: (Long post) Metaphone Algorithm In AWK2Mike Sanders
19 Aug 24 ii`- Re: (Long post) Metaphone Algorithm In AWK1Mike Sanders
20 Aug 24 i`* Re: (Long post) Metaphone Algorithm In AWK6Mike Sanders
21 Aug 24 i `* Re: (Long post) Metaphone Algorithm In AWK5Ben Bacarisse
21 Aug 24 i  `* Re: (Long post) Metaphone Algorithm In AWK4Mike Sanders
21 Aug 24 i   +- Re: (Long post) Metaphone Algorithm In AWK1Mike Sanders
21 Aug 24 i   `* Re: (Long post) Metaphone Algorithm In AWK2Ben Bacarisse
21 Aug 24 i    `- Re: (Long post) Metaphone Algorithm In AWK1Mike Sanders
20 Aug 24 +- Re: (Long post) Metaphone Algorithm In AWK1Mike Sanders
21 Aug 24 +* Re: (Long post) Metaphone Algorithm In AWK3Mike Sanders
21 Aug 24 i`* AWK language trivia (Was: (Long post) Metaphone Algorithm In AWK)2Kenny McCormack
21 Aug 24 i `- Re: AWK language trivia1Mike Sanders
21 Aug 24 +- Re: (Long post) Metaphone Algorithm In AWK1Mike Sanders
23 Aug 24 `- Re: (Long post) Metaphone Algorithm In AWK1Mike Sanders

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal