Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,40 @@
def textonym_value:
gsub("a|b|c|A|B|C"; "2")
| gsub("d|e|f|D|E|F"; "3")
| gsub("g|h|i|G|H|I"; "4")
| gsub("j|k|l|J|K|L"; "5")
| gsub("m|n|o|M|N|O"; "6")
| gsub("p|q|r|s|P|Q|R|S"; "7")
| gsub("t|u|v|T|U|V"; "8")
| gsub("w|x|y|z|W|X|Y|Z"; "9");
def explore:
# given an array (or hash), find the maximum length of the items (or values):
def max_length: [.[] | length] | max;
# The length of the longest textonym in the dictionary of numericString => array:
def longest:
[to_entries[] | select(.value|length > 1) | .key | length] | max;
# pretty-print a key-value pair:
def pp: "\(.key) maps to: \(.value|tostring)";
split("\n")
| map(select(test("^[a-zA-Z]+$"))) # select the strictly alphabetic strings
| length as $nwords
| reduce .[] as $line
( {};
($line | textonym_value) as $key
| .[$key] += [$line] )
| max_length as $max_length
| longest as $longest
| "There are \($nwords) words in the Textonyms/wordlist word list that can be represented by the digit-key mapping.",
"They require \(length) digit combinations to represent them.",
"\( [.[] | select(length>1) ] | length ) digit combinations represent Textonyms.",
"The numbers mapping to the most words map to \($max_length) words:",
(to_entries[] | select((.value|length) == $max_length) | pp ),
"The longest Textonyms in the word list have length \($longest):",
(to_entries[] | select((.key|length) == $longest and (.value|length > 1)) | pp)
;
explore

View file

@ -0,0 +1,9 @@
$ jq -R -r -c -s -f textonyms.jq textonyms.txt
There are 13085 words in the Textonyms/wordlist word list that can be represented by the digit-key mapping.
They require 11932 digit combinations to represent them.
661 digit combinations represent Textonyms.
The numbers mapping to the most words map to 15 words:
27 maps to: ["AP","AQ","AR","AS","Ar","As","BP","BR","BS","Br","CP","CQ","CR","Cr","Cs"]
The longest Textonyms in the word list have length 11:
26456746242 maps to: ["Anglophobia","Anglophobic"]
24636272673 maps to: ["CinemaScope","Cinemascope"]