This is an automated email from the ASF dual-hosted git repository. paulk pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/groovy-website.git
commit 0a06f5cda89d9c0ebeb6d28aa134ec80ec1d8189 Author: Paul King <[email protected]> AuthorDate: Thu Feb 20 13:36:08 2025 +1000 formatting --- site/src/site/blog/groovy-text-similarity.adoc | 278 ++++++++++++------------- 1 file changed, 139 insertions(+), 139 deletions(-) diff --git a/site/src/site/blog/groovy-text-similarity.adoc b/site/src/site/blog/groovy-text-similarity.adoc index ca4bf2e..7bd07fe 100644 --- a/site/src/site/blog/groovy-text-similarity.adoc +++ b/site/src/site/blog/groovy-text-similarity.adoc @@ -753,71 +753,71 @@ as the following results show: ---- Algorithm conceptnet - /c/fr/vache █████████▏ - /c/de/kuh █████████▏ -/c/en/cow /c/en/bovine ███████▏ - /c/fr/bovin ███████▏ - /c/en/bull █████▏ - - /c/fr/taureau █████████▏ - /c/en/cow █████▏ -/c/en/bull /c/fr/vache █████▏ - /c/de/kuh █████▏ - /c/fr/bovin █████▏ - - /c/de/kuh █████▏ - /c/en/cow █████▏ -/c/en/calf /c/fr/vache █████▏ - /c/en/bovine █████▏ - /c/fr/bovin █████▏ - - /c/fr/bovin █████████▏ - /c/en/cow ███████▏ -/c/en/bovine /c/de/kuh ███████▏ - /c/fr/vache ███████▏ - /c/en/calf █████▏ - - /c/en/bovine █████████▏ - /c/fr/vache ███████▏ -/c/fr/bovin /c/de/kuh ███████▏ - /c/en/cow ███████▏ - /c/fr/taureau █████▏ - - /c/en/cow █████████▏ - /c/de/kuh █████████▏ -/c/fr/vache /c/fr/bovin ███████▏ - /c/en/bovine ███████▏ - /c/fr/taureau █████▏ - - /c/en/bull █████████▏ - /c/fr/bovin █████▏ -/c/fr/taureau /c/fr/vache █████▏ - /c/en/cow █████▏ - /c/de/kuh █████▏ - - /c/en/cow █████████▏ - /c/fr/vache █████████▏ -/c/de/kuh /c/fr/bovin ███████▏ - /c/en/bovine ███████▏ - /c/en/calf █████▏ - - /c/en/cat ████████▏ - /c/de/katze ████████▏ -/c/en/kitten /c/en/bull ██▏ - /c/en/cow █▏ - /c/de/kuh █▏ - - /c/de/katze █████████▏ - /c/en/kitten ████████▏ -/c/en/cat /c/en/bull ██▏ - /c/en/cow ██▏ - /c/fr/taureau █▏ - - /c/en/cat █████████▏ - /c/en/kitten ████████▏ -/c/de/katze /c/en/bull ██▏ - /c/de/kuh ██▏ - /c/fr/taureau ██▏ + /c/fr/vache █████████ + /c/de/kuh █████████ +/c/en/cow /c/en/bovine ███████ + /c/fr/bovin ███████ + /c/en/bull █████ + + /c/fr/taureau █████████ + /c/en/cow █████ +/c/en/bull /c/fr/vache █████ + /c/de/kuh █████ + /c/fr/bovin █████ + + /c/de/kuh █████ + /c/en/cow █████ +/c/en/calf /c/fr/vache █████ + /c/en/bovine █████ + /c/fr/bovin █████ + + /c/fr/bovin █████████ + /c/en/cow ███████ +/c/en/bovine /c/de/kuh ███████ + /c/fr/vache ███████ + /c/en/calf █████ + + /c/en/bovine █████████ + /c/fr/vache ███████ +/c/fr/bovin /c/de/kuh ███████ + /c/en/cow ███████ + /c/fr/taureau █████ + + /c/en/cow █████████ + /c/de/kuh █████████ +/c/fr/vache /c/fr/bovin ███████ + /c/en/bovine ███████ + /c/fr/taureau █████ + + /c/en/bull █████████ + /c/fr/bovin █████ +/c/fr/taureau /c/fr/vache █████ + /c/en/cow █████ + /c/de/kuh █████ + + /c/en/cow █████████ + /c/fr/vache █████████ +/c/de/kuh /c/fr/bovin ███████ + /c/en/bovine ███████ + /c/en/calf █████ + + /c/en/cat ████████ + /c/de/katze ████████ +/c/en/kitten /c/en/bull ██ + /c/en/cow █ + /c/de/kuh █ + + /c/de/katze █████████ + /c/en/kitten ████████ +/c/en/cat /c/en/bull ██ + /c/en/cow ██ + /c/fr/taureau █ + + /c/en/cat █████████ + /c/en/kitten ████████ +/c/de/katze /c/en/bull ██ + /c/de/kuh ██ + /c/fr/taureau ██ ---- We won't use this feature for our game, but it would be a great thing to add @@ -1172,12 +1172,12 @@ It has some common vowels and consonants. Let's start with that. ---- Possible letters: a b c d e f g h i j k l m n o p q r s t u v w x y z Guess the hidden word (turn 1): aftershock -LongestCommonSubsequence 0 -Levenshtein Distance: 10, Insert: 0, Delete: 3, Substitute: 7 -Jaccard 0% -JaroWinkler PREFIX 0% / SUFFIX 0% -Phonetic Metaphone=AFTRXK 47% / Soundex=A136 0% -Meaning AnglE 45% / Use 21% / ConceptNet 2% / GloVe -4% / fastText 19% +LongestCommonSubsequence 0 +Levenshtein Distance: 10, Insert: 0, Delete: 3, Substitute: 7 +Jaccard 0% +JaroWinkler PREFIX 0% / SUFFIX 0% +Phonetic Metaphone=AFTRXK 47% / Soundex=A136 0% +Meaning AnglE 45% / Use 21% / ConceptNet 2% / GloVe -4% / fastText 19% ---- It looks like we really bombed out, but in fact this is good news. What did we learn: @@ -1200,12 +1200,12 @@ what we might learn about the vowels. ---- Possible letters: b d g i j l m n p q u v w x y z Guess the hidden word (turn 2): fruit -LongestCommonSubsequence 2 -Levenshtein Distance: 6, Insert: 2, Delete: 0, Substitute: 4 -Jaccard 22% -JaroWinkler PREFIX 56% / SUFFIX 45% -Phonetic Metaphone=FRT 39% / Soundex=F630 0% -Meaning AnglE 64% / Use 41% / ConceptNet 37% / GloVe 31% / fastText 44% +LongestCommonSubsequence 2 +Levenshtein Distance: 6, Insert: 2, Delete: 0, Substitute: 4 +Jaccard 22% +JaroWinkler PREFIX 56% / SUFFIX 45% +Phonetic Metaphone=FRT 39% / Soundex=F630 0% +Meaning AnglE 64% / Use 41% / ConceptNet 37% / GloVe 31% / fastText 44% ---- What did we learn? @@ -1227,13 +1227,13 @@ a kind of food. It's a 50/50 guess. Let's try the first. ---- Possible letters: a b c d e f g h i j k l m n o p q r s t u v w x y z -Guess the hidden word (turn 4): budding -LongestCommonSubsequence 6 -Levenshtein Distance: 1, Insert: 0, Delete: 0, Substitute: 1 -Jaccard 71% -JaroWinkler PREFIX 90% / SUFFIX 96% -Phonetic Metaphone=BTNK 79% / Soundex=B352 75% -Meaning AnglE 52% / Use 35% / ConceptNet 2% / GloVe 4% / fastText 25% +Guess the hidden word (turn 3): budding +LongestCommonSubsequence 6 +Levenshtein Distance: 1, Insert: 0, Delete: 0, Substitute: 1 +Jaccard 71% +JaroWinkler PREFIX 90% / SUFFIX 96% +Phonetic Metaphone=BTNK 79% / Soundex=B352 75% +Meaning AnglE 52% / Use 35% / ConceptNet 2% / GloVe 4% / fastText 25% ---- We have 6 letters right in a row and 5 of the 6 distinct letters. @@ -1243,7 +1243,7 @@ Our other guess of pudding sounds right. Let's try it. ---- Possible letters: a b c d e f g h i j k l m n o p q r s t u v w x y z -Guess the hidden word (turn 5): pudding +Guess the hidden word (turn 4): pudding LongestCommonSubsequence 7 Levenshtein Distance: 0, Insert: 0, Delete: 0, Substitute: 0 Jaccard 100% @@ -1259,12 +1259,12 @@ Congratulations, you guessed correctly! ---- Possible letters: a b c d e f g h i j k l m n o p q r s t u v w x y z Guess the hidden word (turn 1): bail -LongestCommonSubsequence 1 -Levenshtein Distance: 7, Insert: 4, Delete: 0, Substitute: 3 -Jaccard 22% -JaroWinkler PREFIX 42% / SUFFIX 46% -Phonetic Metaphone=BL 38% / Soundex=B400 25% -Meaning AnglE 46% / Use 40% / ConceptNet 0% / GloVe 0% / fastText 31% +LongestCommonSubsequence 1 +Levenshtein Distance: 7, Insert: 4, Delete: 0, Substitute: 3 +Jaccard 22% +JaroWinkler PREFIX 42% / SUFFIX 46% +Phonetic Metaphone=BL 38% / Soundex=B400 25% +Meaning AnglE 46% / Use 40% / ConceptNet 0% / GloVe 0% / fastText 31% ---- * Since LCS is 1, [fuchsia]#the letters shared with the hidden word are in the reverse order#. * There were 4 inserts and 0 deletes which means [fuchsia]#the hidden word has 8 letters#. @@ -1272,12 +1272,12 @@ Meaning AnglE 46% / Use 40% / ConceptNet 0% / GloVe 0% / ---- Possible letters: a b c d e f g h i j k l m n o p q r s t u v w x y z Guess the hidden word (turn 2): leg -LongestCommonSubsequence 2 -Levenshtein Distance: 6, Insert: 5, Delete: 0, Substitute: 1 -Jaccard 25% -JaroWinkler PREFIX 47% / SUFFIX 0% -Phonetic Metaphone=LK 38% / Soundex=L200 0% -Meaning AnglE 50% / Use 18% / ConceptNet 11% / GloVe 13% / fastText 37% +LongestCommonSubsequence 2 +Levenshtein Distance: 6, Insert: 5, Delete: 0, Substitute: 1 +Jaccard 25% +JaroWinkler PREFIX 47% / SUFFIX 0% +Phonetic Metaphone=LK 38% / Soundex=L200 0% +Meaning AnglE 50% / Use 18% / ConceptNet 11% / GloVe 13% / fastText 37% ---- * Jaccard of 2 / 8 tells us [fuchsia]#two of the letters in 'leg' appear in the hidden word#. * LCS of 2 tells us that [fuchsia]#they appear in the same order as in the hidden word#. @@ -1289,12 +1289,12 @@ Let's try a word with 'L' and 'G' near the start: ---- Possible letters: a b c d e f g h i j k l m n o p q r s t u v w x y z Guess the hidden word (turn 3): languish -LongestCommonSubsequence 2 -Levenshtein Distance: 8, Insert: 0, Delete: 0, Substitute: 8 -Jaccard 15% -JaroWinkler PREFIX 50% / SUFFIX 50% -Phonetic Metaphone=LNKX 34% / Soundex=L522 0% -Meaning AnglE 46% / Use 12% / ConceptNet -11% / GloVe -4% / fastText 25% +LongestCommonSubsequence 2 +Levenshtein Distance: 8, Insert: 0, Delete: 0, Substitute: 8 +Jaccard 15% +JaroWinkler PREFIX 50% / SUFFIX 50% +Phonetic Metaphone=LNKX 34% / Soundex=L522 0% +Meaning AnglE 46% / Use 12% / ConceptNet -11% / GloVe -4% / fastText 25% ---- * 8 substitutions means [fuchsia]#none of the letters are in the same spot as 'languish'#. @@ -1302,12 +1302,12 @@ Let's try a word with 'L' and 'E' near the start, bringing at most two letters f ---- Possible letters: a b c d e f g h i j k l m n o p q r s t u v w x y z Guess the hidden word (turn 4): election -LongestCommonSubsequence 5 -Levenshtein Distance: 4, Insert: 0, Delete: 0, Substitute: 4 -Jaccard 40% -JaroWinkler PREFIX 83% / SUFFIX 75% -Phonetic Metaphone=ELKXN 50% / Soundex=E423 75% -Meaning AnglE 47% / Use 13% / ConceptNet -5% / GloVe -7% / fastText 26% +LongestCommonSubsequence 5 +Levenshtein Distance: 4, Insert: 0, Delete: 0, Substitute: 4 +Jaccard 40% +JaroWinkler PREFIX 83% / SUFFIX 75% +Phonetic Metaphone=ELKXN 50% / Soundex=E423 75% +Meaning AnglE 47% / Use 13% / ConceptNet -5% / GloVe -7% / fastText 26% ---- * Jaccard tells us we have 4 distinct letters shared with the hidden word and yet we have a LCS of 5. [fuchsia]#The duplicate 'E' must be correct and the order of all correct letters must match the hidden word.# * Only 4 substitutions means [fuchsia]#8-4=4 letters are in the correct position#. @@ -1318,12 +1318,12 @@ From the LCS of 2 with leg, either 'L','E' is in the hidden word or 'E','G'. Try ---- Possible letters: a b c d e f g h i j k l m n o p q r s t u v w x y z Guess the hidden word (turn 5): elevator -LongestCommonSubsequence 8 -Levenshtein Distance: 0, Insert: 0, Delete: 0, Substitute: 0 -Jaccard 100% -JaroWinkler PREFIX 100% / SUFFIX 100% -Phonetic Metaphone=ELFTR 100% / Soundex=E413 100% -Meaning AnglE 100% / Use 100% / ConceptNet 100% / GloVe 100% / fastText 100% +LongestCommonSubsequence 8 +Levenshtein Distance: 0, Insert: 0, Delete: 0, Substitute: 0 +Jaccard 100% +JaroWinkler PREFIX 100% / SUFFIX 100% +Phonetic Metaphone=ELFTR 100% / Soundex=E413 100% +Meaning AnglE 100% / Use 100% / ConceptNet 100% / GloVe 100% / fastText 100% Congratulations, you guessed correctly! ---- @@ -1333,12 +1333,12 @@ Congratulations, you guessed correctly! ---- Possible letters: a b c d e f g h i j k l m n o p q r s t u v w x y z Guess the hidden word (turn 1): aftershock -LongestCommonSubsequence 3 -Levenshtein Distance: 8, Insert: 0, Delete: 4, Substitute: 4 -Jaccard 50% -JaroWinkler PREFIX 61% / SUFFIX 49% -Phonetic Metaphone=AFTRXK 33% / Soundex=A136 25% -Meaning AnglE 44% / Use 11% / ConceptNet -7% / GloVe 1% / fastText 15% +LongestCommonSubsequence 3 +Levenshtein Distance: 8, Insert: 0, Delete: 4, Substitute: 4 +Jaccard 50% +JaroWinkler PREFIX 61% / SUFFIX 49% +Phonetic Metaphone=AFTRXK 33% / Soundex=A136 25% +Meaning AnglE 44% / Use 11% / ConceptNet -7% / GloVe 1% / fastText 15% ---- What do we know? @@ -1355,12 +1355,12 @@ we aren't duplicating a letter yet, but we just want to narrow down the possibil ---- Possible letters: a b c d e f g h i j k l m n o p q r s t u v w x y z Guess the hidden word (turn 2): coarse -LongestCommonSubsequence 3 -Levenshtein Distance: 4, Insert: 0, Delete: 0, Substitute: 4 -Jaccard 57% -JaroWinkler PREFIX 67% / SUFFIX 67% -Phonetic Metaphone=KRS 74% / Soundex=C620 75% -Meaning AnglE 51% / Use 12% / ConceptNet 5% / GloVe 23% / fastText 26% +LongestCommonSubsequence 3 +Levenshtein Distance: 4, Insert: 0, Delete: 0, Substitute: 4 +Jaccard 57% +JaroWinkler PREFIX 67% / SUFFIX 67% +Phonetic Metaphone=KRS 74% / Soundex=C620 75% +Meaning AnglE 51% / Use 12% / ConceptNet 5% / GloVe 23% / fastText 26% ---- This tells us: @@ -1376,12 +1376,12 @@ and we'll duplicate one letter, S. ---- Possible letters: a b c d e f g h i j k l m n o p q r s t u v w x y z Guess the hidden word (turn 3): roasts -LongestCommonSubsequence 3 -Levenshtein Distance: 6, Insert: 0, Delete: 0, Substitute: 6 -Jaccard 67% -JaroWinkler PREFIX 56% / SUFFIX 56% -Phonetic Metaphone=RSTS 61% / Soundex=R232 25% -Meaning AnglE 54% / Use 25% / ConceptNet 18% / GloVe 18% / fastText 31% +LongestCommonSubsequence 3 +Levenshtein Distance: 6, Insert: 0, Delete: 0, Substitute: 6 +Jaccard 67% +JaroWinkler PREFIX 56% / SUFFIX 56% +Phonetic Metaphone=RSTS 61% / Soundex=R232 25% +Meaning AnglE 54% / Use 25% / ConceptNet 18% / GloVe 18% / fastText 31% ---- We learned: @@ -1396,12 +1396,12 @@ Let's try to word starting with C, related to roasts. ---- Possible letters: a b c d e f g h i j k l m n o p q r s t u v w x y z Guess the hidden word (turn 4): carrot -LongestCommonSubsequence 6 -Levenshtein Distance: 0, Insert: 0, Delete: 0, Substitute: 0 -Jaccard 100% -JaroWinkler PREFIX 100% / SUFFIX 100% -Phonetic Metaphone=KRT 100% / Soundex=C630 100% -Meaning AnglE 100% / Use 100% / ConceptNet 100% / GloVe 100% / fastText 100% +LongestCommonSubsequence 6 +Levenshtein Distance: 0, Insert: 0, Delete: 0, Substitute: 0 +Jaccard 100% +JaroWinkler PREFIX 100% / SUFFIX 100% +Phonetic Metaphone=KRT 100% / Soundex=C630 100% +Meaning AnglE 100% / Use 100% / ConceptNet 100% / GloVe 100% / fastText 100% Congratulations, you guessed correctly! ----
