– you have earned Featured Contributor Badge ![]()
Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!
PalindromeQ also works.
Thanks so much!
The only thing that PalindromeQ can’t do is find integer palindromes in different bases, for example base 3. Then you have to use IntegerReverse and IntegerDigits to convert to the different base.
I have a feature request I’ve submitted though to add functionality for integers in different bases.
Good point—I think I will edit that in.
Functionality for integers in different bases!? Your post is definitely so fun but we can reverse palindromes, where the first half of the word equals the last half. What would you do if you had palindromes where we filtered by DictionaryWordQ? Start with dictionary words, like Where’s Waldo.
WoRdyLisT = Select[WordList["KnownWords"], DictionaryWordQ];
words = Select[WoRdyLisT, # == StringReverse[#] &];
WordCloud[words, WordOrientation -> "Random"]
firstHalf[w_String] :=
StringTake[w, {1, Floor[StringLength[w]/2.0]}];
lastHalf[w_String] := StringTake[w, {-Floor[StringLength[w]/2.0], -1}];
words = Select[words, firstHalf[#] == lastHalf[#] &];
WordCloud[words, WordOrientation -> "HorizontalVertical"]
When finding bogus word pairs, comparing grammatical and agrammatical phrases we get a larger inner product for the grammatical. How would you satisfy the Reduplication Requirement, phonetically? Why are yob and boy valid but not amora, in the original list?
notPalindromes = Select[WoRdyLisT, # != StringReverse[#] &];
conceptNet = NetModel["ConceptNet Numberbatch Word Vectors V17.06"];
WordBogusPair[w1_String, w2_String] :=
w1 <> " " <> w2 ->
Flatten[conceptNet[{w1}]] . Flatten[conceptNet[{w2}]];
PhraseBogusPair[phrase_String] :=
Apply[WordBogusPair, Flatten[StringSplit[phrase, " "]]]
wordPairs = Union[Drop[Map[# &,
{#, StringReverse[#],
PhraseBogusPair[# <> " " <> StringReverse[#]][[2]]} & /@
Select[notPalindromes,
DictionaryWordQ[StringReverse[#], IgnoreCase -> True] &]
], 1]];
innerProduct =
ToExpression /@
Select[Map[#[[3]] &, wordPairs[[2 ;; Length[wordPairs]]]], # > 0 &];
phraseBogusBound[bound_] := Select[wordPairs, #[[3]] > bound &]
sortReversibleWords =
Sort[phraseBogusBound[0.3], #1[[3]] < #2[[3]] &];
With[{length = Length[sortReversibleWords]}, Grid[
Prepend[
sortReversibleWords,
{"Word",
"Reverse",
"Inner Product"}],
Alignment -> Left,
Spacings -> {0, 0},
Background -> {{
{},
CMYKColor[0, 0, 0, 0],
{}},
Table[
CMYKColor[1 - (i/length), i/length, 0, 0, .1],
{i, 1, length + 1}]}]]
@Chase Marangu @Peter Cullen Burbery. How would you have Mathematica play audio when you press ⌘ S like macOS Notes plays? The Shift plus Return sound is high-pitched and vibrant.
Show[
ListPlot[
Table[
Labeled[{i,
wordPairs[[i]][[3]]},
wordPairs[[i]][[1]]],
{i, 1, Length[wordPairs]}]],
ImageSize -> Full]
BarChart[Map[#[[3]] &, sortReversibleWords],
ChartLabels -> Map[#[[1]] &, sortReversibleWords],
ChartStyle -> "Pastel",
BarSpacing -> 1,
ImageSize -> Full,
BarOrigin -> Left,
Epilog -> {Black, Thin, Line[{{0.3, 0}, {0.3, Length[yAxis]}}]},
FrameLabel -> "Reversible Words",
Frame -> True]
Is there a way to suppress all the output of our functions if need be? Like the opposite of PrependTo—Wolfram Documentation? Have you found the indefinitely repeating color list for our word pair graphs - ColorData[100, "ColorList”]? What’s the way to @ with Table - Flatten@Table[ColorData[i, "ColorList"], {i, 1, 43}]? And sometimes look at [WSS22] Extracting linguistic relations fr. word embeddings&language models! [WSS22] Extracting linguistic relations fr. word embeddings&language models . It’s all about bogus words and non-bogus, more than I could have asked for.
Eve Eve. Malayalam Malayalam. Ara Ara. Mam Mam. Ono Ono. Tevet Tevet. Tet Tet.
Thank you for working with PalindromeQ, that is phenomenal. @Peter Cullen Burbery what’s the feature request?
The feature request is issue 2245 on redmine.
Hi Dean Gladish,
You almost outdid my post with your reply! using DictionaryWordQ on WordList[“KnownWords”] seems to give you an interesting word cloud, though I mostly stick to WordList[“CommonWords”] unless it’s too hard to find common words with the properties I’m looking for. I am certainly impressed by your idea to use the Inner Product to check for palindromes - I had been wondering to account for near-miss palindromes myself!
Also, I also was fascinated by Cayden’s WSS22 post,
The exploration above indicates that two-word English phrases have a larger inner product than improper two-word English phrases.
That section of Caden’s article blew my mind the most, the fact that the meaning of words was actually connected to the letters and their position in the sentence. Cayden is working on software for his smart glasses to automatically transcribe conversations; the guy’s on another level. I can’t wait to see where he takes that project!
Anyways, thanks for always posting the most detailed responses to my posts, Dean!
What does it mean to make a word cloud out of a word square..
wordsquare[s_String] :=
Module[{n = StringLength[s], c = {{Characters[s]}}, w, m = 1},
w = Characters /@
Select[WordList[], StringMatchQ[#, Repeated[_, {n}]] &];
NestWhile[computewords[w, n, m++, #] &, c, m < n &]]
computewords[w_, n_Integer, m_Integer, c_List] :=
Flatten[
DeleteCases[
Map[Cases[w,
p : Append[#[[All, m + 1]], Repeated[_, {n - m}]] :>
Append[#, p]] &, c], {}], 1]
Table[WordCloud[wordsquare["twain"][[i]][[j]]], {i, 1,
Length[wordsquare["twain"]]}, {j, 1, 3}]
Hi Chase Marangu. I liked your post, it’s nice to read for a newcomer, with all those word clouds. I have a question: I wanted to know if studying computational linguistics or Natural Language Processing in a formal way, like as a Masters or something, would require previous programming experience. Would a person with just basic experience in programming languages find it difficult?
And also, does this field have a good future in terms of a career? Are there decently paying jobs out there in this compling/NLP field?
Thanks!
Do you know to make a word cube? I wanted to add a word cube function to my WordCloud paclet
but I couldn’t figure it out.
Peter! Ever since I was a little kid I wanted to know how to make a Word Cube, and ever since WordCloud came out I’ve been all on it. I don’t know. What is a Word Cube, non-quantitatively?
I know Donald Knuth has created a program to find a word cube but I don’t know how to do it in Mathematica. A word cube is like a symmetric tensor of rank 3.
That was a superb exploration we just did and yeah there are so many word cubes, and Donald Knuth made this program to find a word cube. So take a look at WordGraph… how do you get access to the WordCloud paclet? It sort of looks like the perfect repository for word cubes… what are they? What is the symmetric rank 3 tensor like, Peter?
ListLinePlot[ LowpassFilter[ WordFrequencyData /@ {"mouse", "douse", "house", "louse", "moose", "mousy", "rouse", "souse", "dowse", "horse", "loose", "lousy", "goose", "noose", "mossy", "reuse", "rouge", "route"}, 0.5, 15], Mesh -> { {-2, 0, 2}, {0, 1}}, MeshStyle -> Orange]
Thank you so much for this one in particular, I’ve been waiting so long for this paclet to come out and now it’s finally here!
I found a post that has a program to create a random word cube or square but unfortunately, it doesn’t let you specify a word to make a word cube out of.
Yeah does it let us specify stuff like this? That’s like how the WordGraphs lead us everywhere. Why can’t we parameterize them & specify them like we did when we hard-coded it? Then it’ll be less fragile and it will be prone. Try reading through this you can have DictionaryLookup[Repeated[_, {4}]] or you can have this script. How do you know what the words are?
ClearAll[findWordHypercube];
Begin["`findWordHypercube`"];
ClearAll[inspect, nextIndices, indices, tag];
Options[findWordHypercube] = {"Random" -> True};
findWordHypercube[dims_Integer, len_Integer, op : OptionsPattern[]] :=
findWordHypercube[ConstantArray[_, len~ConstantArray~dims], op]
findWordHypercube[mat_, OptionsPattern[]] :=
Block[{$random =
If[OptionValue["Random"], RandomSample,
Identity], $RecursionLimit = Infinity, $IterationLimit =
Infinity, dictCache}, Catch[inspect[mat] =!= Null, tag]];
dict[numLetters_] :=
Replace[dictCache[numLetters], _dictCache :> (dictCache[numLetters] =
{"Abba", "abbe", "abbé", "Abby", "abed", "Abel", "abet", "able",
"ably", "abut", "aced", "aces", "ache", "achy", "acid",
"acme", "acne", "acre", "acts", "Acts", "Adam", "Adan", "Adar",
"adds", "Aden", "afar", "Afro", "agar", "aged", "ages",
"Agni", "agog", "Agra", "ague", "Ahab", "ahas", "ahem", "ahoy",
"Aida", "aide", "aids", "AIDS", "ails", "aims", "Ainu",
"airs", "airy", "ajar", "Ajax", "akin", "Alan", "Alar", "alas",
"Alas", "Alba", "albs", "Aldo", "Alec", "ales", "Alex",
"alga", "Alis", "ally", "Alma", "alms", "aloe", "Alpo", "alps",
"Alps", "also", "Alta", "alto", "alts", "alum", "Alva",
"amen", "Amen", "amid", "Amie", "ammo", "amok", "Amos", "amps",
"Amur", "anal", "ands", "Andy", "anew", "ankh", "Anna",
"Anne", "anon", "ante", "anti", "ants", "anus", "aped", "apes",
"apex", "Apia", "apse", "aqua", "Arab", "Aral", "arch",
"Arch", "arcs", "area", "ares", "Ares", "Argo", "aria", "arid",
"arks", "arms", "army", "Arne", "Arno", "Aron", "arts",
"arty", "arum", "asap", "Ashe", "ashy", "Asia", "asks", "asps",
"ates", "atom", "atop", "Aube", "Audi", "auks", "aunt",
"aura", "auto", "aver", "aves", "Aves", "avid", "Avis", "Avon",
"avow", "away", "awed", "awes", "awls", "awns", "awry",
"axed", "Axel", "axes", "axis", "Axis", "axle", "axon", "Axum",
"ayah", "ayes", "Azov", "Baal", "baas", "babe", "baby",
"Bach", "back", "bade", "Baez", "bags", "bahs", "baht", "bail",
"bait", "bake", "Baku", "bald", "bale", "Bali", "balk",
"ball", "Ball", "balm", "band", "bane", "bang", "bani", "bank",
"bans", "baps", "barb", "bard", "bare", "barf", "Bari",
"bark", "barn", "Barr", "bars", "Bart", "base", "bash", "bask",
"bass", "Bass", "bast", "bate", "bath", "bats", "Batu",
"baud", "Baum", "bawd", "bawl", "bays", "bead", "beak", "beam",
"bean", "Bean", "bear", "beat", "beau", "Beau", "beck",
"Beck", "Bede", "beds", "beef", "been", "beep", "beer", "bees",
"beet", "begs", "Bela", "bell", "Bell", "belt", "bend",
"bent", "Benz", "berg", "Berg", "berk", "berm", "Bern", "Bert",
"Bess", "best", "Best", "beta", "Beth", "bets", "bevy",
"beys", "bias", "bibs", "bide", "bids", "bier", "biff", "bike",
"Biko", "bile", "bilk", "bill", "Bill", "bind", "Bing",
"bins", "bios", "BIOS", "bird", "Bird", "Biro", "bite", "bits",
"blab", "blag", "blah", "bled", "blew", "blip", "blob",
"bloc", "blot", "blow", "blue", "blur", "boar", "boas", "Boas",
"boat", "bobs", "bock", "bode", "bods", "body", "Boer",
"bogs", "Bohr", "boil", "bola", "bold", "bole", "boll", "bolt",
"bomb", "bond", "Bond", "bone", "bong", "bonk", "Bonn",
"bony", "boob", "book", "boom", "boon", "boor", "boos", "boot",
"bops", "bore", "Borg", "Bork", "born", "Born", "Boru",
"Bose", "bosh", "boss", "both", "bots", "bout", "bowl", "bows",
"boxy", "Boyd", "boys", "bozo", "brad", "Brad", "brae",
"brag", "bran", "Bran", "bras", "brat", "bray", "Bray", "bred",
"Bren", "Bret", "brew", "brie", "Brie", "brig", "brim",
"brio", "Brit", "Brno", "brow", "Brut", "bubo", "bubs", "buck",
"Buck", "buds", "buff", "bugs", "bulb", "bulk", "bull",
"bumf", "bump", "bums", "bung", "bunk", "buns", "bunt", "buoy",
"burg", "burk", "burl", "Burl", "burn", "burp", "burr",
"Burr", "burs", "Burt", "bury", "bush", "Bush", "busk", "buss",
"bust", "busy", "buts", "butt", "buys", "buzz", "byes",
"Byrd", "byre", "byte", "cabs", "cads", "cafe", "café", "caff",
"cage", "Cage", "Cain", "cake", "calf", "Cali", "call",
"calm", "came", "camp", "cams", "cane", "cans", "cant", "cape",
"Caph", "capo", "caps", "Cara", "card", "care", "Carl",
"carp", "Carr", "cars", "cart", "Cary", "case", "Case", "cash",
"Cash", "cask", "cast", "Cato", "cats", "Catt", "cave",
"caws", "cays", "Cebu", "ceca", "cede", "cell", "Celt", "cent",
"Cerf", "Chad", "Chan", "chap", "char", "chat", "chef",
"Chen", "Cher", "chew", "chic", "chid", "chin", "chip", "chis",
"chit", "choc", "chop", "Chou", "chow", "chub", "chug",
"chum", "ciao", "cine", "cite", "cits", "city", "clad", "clam",
"clan", "clap", "claw", "clay", "Clay", "clef", "Clem",
"Cleo", "clew", "Clio", "clip", "clod", "clog", "clop", "clot",
"cloy", "club", "clue", "coal", "coat", "coax", "Cobb",
"cobs", "coca", "cock", "coco", "coda", "code", "cods", "Cody",
"coed", "cogs", "coho", "coif", "coil", "coin", "coir",
"coke", "Coke", "cola", "cold", "Cole", "Colo", "cols", "colt",
"Colt", "coma", "comb", "come", "Como", "cone", "Cong",
"conk", "cons", "cony", "cook", "Cook", "cool", "coon", "coop",
"coos", "coot", "cope", "cops", "copy", "Cora", "cord",
"core", "cork", "Cork", "corm", "corn", "Cory", "cosh", "cost",
"cote", "Cote", "cots", "coup", "cove", "cowl", "cows",
"cozy", "crab", "crag", "cram", "crap", "craw", "Cray", "cred",
"Cree", "crew", "crib", "crop", "crow", "Crow", "crud",
"crux", "Crux", "Cruz", "Cuba", "cube", "cubs", "cuds", "cued",
"cues", "cuff", "cull", "cult", "cups", "curb", "curd",
"cure", "curl", "curs", "curt", "Curt", "cusp", "cuss", "cute",
"cuts", "cyan", "cyst", "czar", "dabs", "dace", "Dada",
"dado", "dads", "daft", "dags", "dais", "dale", "Dale", "Dali",
"dame", "Dame", "damn", "damp", "dams", "Dana", "Dane",
"dang", "dank", "Dans", "dare", "Dare", "dark", "darn", "dart",
"dash", "data", "date", "daub", "Dave", "Davy", "dawn",
"Dawn", "days", "daze", "dead", "deaf", "deal", "dean", "Dean",
"dear", "debs", "Debs", "debt", "deck", "deco", "deed",
"deem", "deep", "deer", "deft", "defy", "deli", "dell", "demo",
"Dena", "Dene", "Deng", "dens", "dent", "deny", "Deon",
"derv", "desk", "Devi", "dews", "dewy", "dhow", "dial", "Dial",
"Dias", "dibs", "dice", "Dick", "dido", "Dido", "died",
"Diem", "dies", "diet", "digs", "dike", "dill", "dime", "dims",
"Dina", "dine", "ding", "Dino", "dins", "dint", "Dion",
"Dior", "dips", "dire", "dirk", "Dirk", "dirt", "disc", "dish",
"disk", "ditz", "diva", "dive", "divs", "dobs", "dock",
"docs", "dodo", "doer", "does", "doff", "doge", "dogs", "Doha",
"dole", "Dole", "doll", "dolt", "dome", "dona", "Dona",
"done", "Donn", "dons", "Dons", "doom", "door", "dopa", "dope",
"Dora", "Dore", "dork", "dorm", "dory", "dose", "dosh",
"doss", "dost", "dote", "doth", "dots", "Doug", "dour", "dove",
"down", "doze", "dozy", "drab", "drag", "dram", "drat",
"draw", "dray", "drew", "Drew", "drip", "drop", "drub", "drug",
"drum", "drys", "dual", "dubs", "duck", "duct", "dude",
"duds", "duel", "dues", "duet", "duff", "duke", "Duke", "dull",
"duly", "dumb", "dump", "dune", "dung", "dunk", "Dunn",
"duns", "duos", "dupe", "Duse", "dusk", "dust", "duty", "DVDs",
"dyad", "dyed", "dyer", "Dyer", "dyes", "dyne", "each",
"earl", "Earl", "earn", "Earp", "ears", "ease", "east", "East",
"easy", "eats", "eave", "eBay", "ebbs", "Eben", "Ebro",
"echo", "ecru", "ecus", "Edam", "Edda", "eddy", "Eddy", "Eden",
"edge", "edgy", "edit", "Edna", "eeks", "eels", "e'en",
"e'er", "effs", "egad", "Eggo", "eggs", "egos", "Eire", "eked",
"ekes", "Elam", "elan", "élan", "Elba", "Elbe", "Elia",
"elks", "Ella", "ells", "Elma", "Elmo", "elms", "Eloy", "Elsa",
"else", "Elul", "Elva", "emfs", "Emil", "emir", "emit",
"Emma", "Emmy", "emus", "ends", "Enid", "Enif", "Enos", "envy",
"eons", "epee", "épée", "epic", "eras", "ergo", "ergs",
"Eric", "Erie", "Erik", "Erin", "Eris", "Erma", "Erna", "Eros",
"errs", "Erse", "erst", "Esau", "espy", "etas", "etch",
"Etna", "Eton", "Etta", "Eula", "euro", "Evan", "even", "ever",
"eves", "evil", "ewer", "ewes", "exam", "exec", "exes",
"exit", "expo", "Eyck", "eyed", "eyes", "Eyre", "Ezra", "face",
"fact", "fade", "fads", "faff", "fags", "Fahd", "fail",
"fain", "fair", "fake", "fall", "fame", "fang", "fans", "FAQs",
"fare", "farm", "faro", "fast", "fate", "fats", "faun",
"fave", "fawn", "Faye", "fays", "faze", "fear", "feat", "feds",
"Feds", "feed", "feel", "fees", "feet", "fell", "felt",
"fems", "fend", "fens", "fern", "Fern", "fess", "fest", "feta",
"fete", "fête", "feud", "fiat", "Fiat", "fibs", "Fido",
"fief", "fies", "fife", "figs", "Fiji", "file", "fill", "film",
"filo", "find", "fine", "fink", "Finn", "fins", "fire",
"firm", "firs", "fish", "Fisk", "fist", "fits", "five", "fizz",
"flab", "flag", "flak", "flam", "flan", "flap", "flat",
"flaw", "flax", "flay", "flea", "fled", "flee", "Flem", "flew",
"flex", "flip", "flit", "floe", "flog", "flop", "flow",
"flub", "flue", "flux", "FNMA", "foal", "foam", "fobs", "Foch",
"foes", "fogs", "fogy", "foil", "fold", "folk", "fond",
"Fons", "font", "food", "fool", "foot", "fops", "ford", "Ford",
"fore", "fork", "form", "fort", "foul", "four", "fowl",
"foxy", "Fran", "frat", "Frau", "fray", "Fred", "free", "fret",
"Frey", "frig", "frog", "from", "Frye", "fuel", "Fuji",
"full", "fume", "fumy", "fund", "funk", "furl", "furs", "fury",
"fuse", "fuss", "futz", "fuzz", "gabs", "gads", "Gaea",
"Gael", "gaff", "gaga", "gage", "Gage", "gags", "Gail", "gain",
"gait", "gala", "gale", "Gale", "gall", "Gall", "gals",
"Gama", "game", "gamy", "gang", "gaol", "gape", "gaps", "garb",
"Gard", "gars", "Gary", "gash", "gasp", "gate", "Gaul",
"gave", "gawd", "gawk", "gawp", "gays", "Gaza", "gaze", "gear",
"geed", "geek", "gees", "geld", "gels", "gems", "Gena",
"gene", "Gene", "gens", "gent", "germ", "gets", "ghat", "ghee",
"gibe", "Gide", "gift", "gigs", "Gila", "gild", "gill",
"Gill", "gilt", "gimp", "Gina", "Gino", "gins", "gird", "girl",
"giro", "girt", "Gish", "gist", "gite", "gits", "give",
"Giza", "glad", "glam", "glee", "glen", "Glen", "glib", "glob",
"glop", "glow", "glue", "glum", "glut", "GMAT", "gnat",
"gnaw", "gnus", "goad", "goal", "goat", "Gobi", "gobs", "gods",
"goer", "goes", "Goff", "gold", "golf", "gone", "gong",
"good", "Good", "goof", "goon", "goop", "gore", "Gore", "gorp",
"gory", "gosh", "goth", "Goth", "gout", "govs", "gown",
"Goya", "grab", "grad", "gram", "gran", "gray", "Gray", "Greg",
"grew", "Grey", "grid", "grim", "grin", "grip", "Gris",
"grit", "grog", "grow", "grub", "Grus", "Guam", "guff", "gulf",
"gull", "gulp", "gums", "gunk", "guns", "guru", "gush",
"gust", "guts", "guvs", "guys", "Gwen", "Gwyn", "gyms", "gyps",
"gyro", "gyve", "Haas", "hack", "haft", "hags", "Hahn",
"hail", "hair", "hajj", "hake", "hale", "Hale", "half", "hall",
"Hall", "halo", "Hals", "halt", "hams", "hand", "hang",
"hank", "Hank", "Hans", "hard", "hare", "hark", "harm", "harp",
"hart", "Hart", "hash", "hasp", "hast", "hate", "hath",
"hats", "haul", "have", "hawk", "haws", "hays", "Hays", "haze",
"hazy", "head", "Head", "heal", "heap", "hear", "heat",
"Hebe", "heck", "he'd", "heed", "heel", "Heep", "heft", "heir",
"held", "hell", "helm", "help", "heme", "hemp", "hems",
"hens", "heps", "Hera", "herb", "herd", "here", "hero", "Herr",
"hers", "he's", "Hess", "hews", "hick", "hide", "hied",
"hies", "high", "hike", "hill", "Hill", "hilt", "hims", "hind",
"hint", "hips", "hire", "hiss", "Hiss", "hits", "hive",
"hiya", "hoar", "hoax", "hobo", "hobs", "hock", "hods", "hoed",
"hoer", "hoes", "Hoff", "hogs", "hoke", "hold", "hole",
"hols", "Holt", "holy", "home", "hone", "honk", "hons", "hood",
"Hood", "hoof", "hook", "hoop", "hoot", "hope", "Hope",
"Hopi", "hops", "hora", "horn", "Horn", "hose", "host", "Host",
"hots", "hour", "hove", "Howe", "howl", "hows", "HTML",
"HTTP", "hubs", "Huck", "hued", "hues", "Huey", "huff", "Huff",
"huge", "Hugh", "Hugo", "hugs", "huhs", "hula", "hulk",
"hull", "Hull", "Hume", "hump", "hums", "hung", "Hung", "hunk",
"Huns", "hunt", "Hunt", "hurl", "hurt", "hush", "husk",
"huts", "Hutu", "Hyde", "hymn", "hype", "hypo", "Iago", "iamb",
"ibex", "ibis", "iced", "ices", "icky", "icon", "idea",
"idem", "ides", "idle", "idly", "idol", "iffy", "Igor", "ilea",
"ilia", "ilks", "I'll", "ills", "imam", "imps", "Imus",
"Inca", "inch", "Indy", "Ines", "Inez", "info", "Inge", "inks",
"inky", "inns", "inti", "into", "Iona", "ions", "iota",
"Iowa", "Iran", "Iraq", "ired", "ires", "iris", "Iris", "irks",
"Irma", "iron", "ISBN", "Isis", "isle", "isms", "itch",
"it'd", "item", "it's", "Ivan", "I've", "Ives", "Iyar", "Izod",
"jabs", "jack", "Jack", "jade", "jags", "jail", "Jain",
"Jake", "jamb", "Jame", "Jami", "jams", "Jana", "Jane", "jape",
"jars", "jato", "java", "Java", "jaws", "jays", "jazz",
"jean", "Jean", "Jedi", "jeep", "Jeep", "jeer", "jeez", "Jeff",
"Jehu", "jell", "Jena", "Jeri", "jerk", "Jess", "jest",
"jets", "Jews", "jibe", "jibs", "jiff", "jigs", "Jill", "jilt",
"jink", "jinn", "jinx", "jive", "Joan", "jobs", "Jobs",
"jock", "Jock", "Jodi", "Jody", "Joel", "joey", "Joey", "jogs",
"john", "John", "join", "joke", "jolt", "Joni", "Jose",
"josh", "Josh", "jots", "Jove", "jowl", "joys", "Juan", "Judd",
"Jude", "judo", "Judy", "jugs", "July", "jump", "June",
"Jung", "junk", "Juno", "jury", "just", "jute", "juts", "Kalb",
"kale", "Kali", "Kama", "Kane", "Kano", "Kans", "Kant",
"Kara", "Kari", "Karl", "Karo", "kart", "Kass", "Kate", "Katy",
"Kaye", "kayo", "Kean", "Keck", "keel", "keen", "keep",
"kegs", "kelp", "Kemp", "keno", "kens", "Kent", "kepi", "kept",
"Keri", "Kern", "Kerr", "keys", "khan", "Khan", "kick",
"Kidd", "kids", "Kiel", "Kiev", "kill", "kiln", "kilo", "kilt",
"kind", "kine", "king", "King", "kink", "kins", "kips",
"kirk", "Kirk", "kiss", "kite", "kith", "kits", "kiwi", "Klan",
"Klee", "knee", "knew", "knit", "knob", "knot", "know",
"Knox", "Kobe", "Koch", "kohl", "Kohl", "kola", "Kong", "kook",
"Kory", "Kris", "Kroc", "Kuhn", "Kurd", "Kurt", "kyle",
"Kyle", "labs", "Labs", "lace", "lack", "lacs", "lacy", "Lacy",
"lade", "lads", "lady", "Lady", "lags", "laid", "lain",
"lair", "lake", "lama", "lamb", "Lamb", "lame", "lamp", "lams",
"Lana", "land", "Land", "lane", "Lane", "Lang", "lank",
"Laos", "Lapp", "laps", "Lara", "lard", "lark", "Lars", "lase",
"lash", "lass", "last", "late", "lath", "lats", "laud",
"Laud", "Laue", "lava", "lave", "lavs", "lawn", "laws", "lays",
"laze", "lazy", "lead", "leaf", "Leah", "leak", "lean",
"Lean", "leap", "Lear", "leas", "lech", "Leda", "leek", "leer",
"lees", "left", "Left", "Lego", "legs", "Leif", "leis",
"Lela", "Lena", "lend", "Leno", "lens", "lent", "Lent", "Leon",
"Leos", "Lesa", "less", "lest", "Leta", "lets", "Levi",
"levy", "Levy", "lewd", "liar", "libs", "lice", "lick", "lido",
"lids", "lied", "lief", "lien", "lies", "lieu", "life",
"lift", "like", "Lila", "lilo", "lilt", "lily", "Lily", "Lima",
"limb", "lime", "limn", "limo", "limp", "limy", "Lina",
"Lind", "line", "link", "lino", "lint", "lion", "Lion", "lips",
"lira", "lire", "Lisa", "lisp", "list", "lite", "live",
"Livy", "Liza", "load", "loaf", "loam", "loan", "lobe", "lobs",
"loch", "loci", "lock", "loco", "lode", "Lodz", "loft",
"loge", "logo", "logs", "logy", "loin", "Lois", "Loki", "Lola",
"loll", "Lome", "lone", "long", "Long", "look", "loom",
"loon", "loop", "loos", "loot", "lope", "lops", "Lora", "lord",
"Lord", "lore", "Lori", "lorn", "lose", "loss", "lost",
"lots", "Lott", "loud", "lour", "lout", "love", "Love", "Lowe",
"lows", "Loyd", "LSAT", "luau", "lube", "Luce", "luck",
"Lucy", "ludo", "luff", "luge", "lugs", "Luis", "Luke", "Lula",
"lull", "lulu", "Lulu", "lump", "Luna", "lune", "lung",
"Lupe", "lure", "lurk", "lush", "lust", "lute", "luvs", "Luvs",
"Lvov", "Lyle", "Lyly", "Lyme", "Lynn", "lynx", "Lyon",
"Lyra", "lyre", "mace", "Mace", "Mach", "mack", "Mack", "macs",
"Macs", "Macy", "made", "magi", "Magi", "mags", "Maia",
"maid", "mail", "maim", "main", "make", "male", "Male", "Mali",
"mall", "malt", "mama", "mams", "mane", "Mani", "Mann",
"mans", "Manx", "many", "maps", "Mara", "Marc", "mare", "Mari",
"mark", "Mark", "marl", "mars", "Mars", "mart", "Marx",
"Mary", "mash", "mask", "mass", "mast", "mate", "math", "mats",
"Matt", "Maud", "Maui", "maul", "maws", "maxi", "Maya",
"mayo", "Mayo", "Mays", "maze", "mead", "Mead", "meal", "mean",
"meat", "meed", "meek", "meet", "mega", "megs", "Meir",
"meld", "melt", "memo", "mend", "menu", "meow", "mere", "mesa",
"Mesa", "mesh", "mess", "Meta", "mete", "mewl", "mews",
"mica", "mice", "Mick", "mics", "midi", "mien", "miff", "mike",
"Mike", "mild", "mile", "milk", "mill", "Mill", "Milo",
"mils", "milt", "mime", "Mimi", "mind", "mine", "Ming", "mini",
"mink", "mint", "minx", "Mira", "mire", "Miro", "miry",
"miss", "mist", "mite", "mitt", "moan", "moat", "mobs", "mock",
"mode", "mods", "Moho", "moil", "mold", "mole", "moll",
"Moll", "molt", "moms", "Mona", "monk", "Monk", "mono", "mood",
"Moog", "moon", "Moon", "moor", "Moor", "moos", "moot",
"mope", "mops", "more", "More", "morn", "Moro", "Mort", "mosh",
"moss", "Moss", "most", "mote", "moth", "mots", "Mott",
"moue", "move", "mows", "Mses", "much", "muck", "muff", "mugs",
"Muir", "mule", "mull", "mums", "muns", "murk", "muse",
"Muse", "mush", "musk", "muss", "must", "mute", "mutt", "myna",
"Myra", "Myst", "myth", "nabs", "naff", "nags", "Nagy",
"naif", "nail", "Nair", "name", "nans", "nape", "naps", "Nara",
"narc", "nary", "NASA", "Nash", "Nate", "NATO", "nave",
"navy", "Navy", "nays", "Nazi", "NCAA", "Neal", "neap", "near",
"neat", "neck", "need", "negs", "Neil", "Nell", "neon",
"nerd", "Nerf", "Nero", "nest", "nets", "nett", "nevi", "news",
"newt", "next", "nibs", "nice", "Nice", "nick", "Nick",
"niff", "nigh", "Nike", "Nile", "nils", "Nina", "nine", "nips",
"Nita", "nits", "Noah", "nobs", "node", "nods", "noel",
"Noel", "noes", "Nola", "Nome", "Nona", "none", "nook", "noon",
"nope", "Nora", "norm", "nose", "nosh", "nosy", "note",
"noun", "nous", "nova", "Nova", "nowt", "nubs", "nude", "nuke",
"null", "numb", "nuns", "nuts", "oafs", "Oahu", "oaks",
"oars", "oath", "oats", "obey", "Obie", "obis", "obit", "oboe",
"odds", "Oder", "odes", "Odin", "Odis", "Odom", "odor",
"o'er", "offs", "ogle", "ogre", "Ohio", "ohms", "ohos", "OHSA",
"oiks", "oils", "oily", "oink", "Oise", "okay", "okra",
"Olaf", "Olav", "Olen", "oleo", "oles", "Olga", "Olin", "Oman",
"Omar", "omen", "omit", "Omsk", "once", "ones", "only",
"onto", "onus", "onyx", "oohs", "oops", "Oort", "ooze", "oozy",
"opal", "Opal", "OPEC", "oped", "Opel", "open", "opes",
"opts", "opus", "oral", "Oran", "orbs", "Oreo", "ores", "orgy",
"Orin", "Orly", "orzo", "Oslo", "Otis", "Otto", "ouch",
"ours", "oust", "outs", "ouzo", "oval", "oven", "over", "Ovid",
"ovum", "owed", "Owen", "owes", "owls", "owns", "oxen",
"oxes", "Oxus", "Paar", "pace", "Pace", "pack", "pact", "pacy",
"pads", "page", "Page", "paid", "pail", "pain", "pair",
"pale", "pall", "palm", "pals", "pane", "pang", "pans", "pant",
"papa", "paps", "para", "pare", "park", "Park", "Parr",
"pars", "part", "pass", "past", "pate", "Pate", "path", "pats",
"Paul", "pave", "pawl", "pawn", "paws", "pays", "peak",
"peal", "pear", "peas", "peat", "peck", "Peck", "pecs", "peed",
"peek", "peel", "Peel", "peen", "peep", "peer", "pees",
"pegs", "peke", "Pele", "pelf", "pelt", "Pena", "pens", "pent",
"peon", "peps", "perk", "Perl", "perm", "Perm", "pert",
"Peru", "perv", "peso", "pest", "Pete", "pets", "pews", "phat",
"phew", "phis", "Piaf", "pica", "pick", "pics", "pied",
"pier", "pies", "pigs", "pike", "Pike", "pile", "pill", "pimp",
"pine", "ping", "pink", "pins", "pint", "piny", "pipe",
"pips", "Pisa", "pita", "pith", "pits", "Pitt", "pity", "Pius",
"plan", "play", "plea", "pleb", "plod", "plop", "plot",
"plow", "ploy", "plug", "plum", "plus", "pock", "pods", "poem",
"poet", "pogo", "Pogo", "poke", "poky", "pole", "Pole",
"Polk", "poll", "polo", "Polo", "pols", "poly", "pomp", "poms",
"pond", "pone", "pong", "pony", "poof", "pooh", "Pooh",
"pool", "poop", "poor", "pope", "Pope", "pops", "pore", "pork",
"porn", "port", "pose", "posh", "post", "Post", "posy",
"pots", "pouf", "pour", "pout", "poxy", "pram", "prat", "pray",
"prep", "prey", "prig", "prim", "prod", "prof", "prom",
"prop", "pros", "prow", "Prut", "psis", "psst", "Ptah", "pubs",
"puce", "puck", "Puck", "puds", "puff", "Pugh", "pugs",
"puke", "pule", "pull", "pulp", "puma", "pump", "punk", "puns",
"punt", "puny", "pupa", "pups", "pure", "purl", "purr",
"push", "puss", "puts", "putt", "putz", "Puzo", "Pyle", "pyre",
"quad", "quay", "quid", "quin", "quip", "quit", "quiz",
"Rabi", "race", "rack", "racy", "rads", "raft", "raga", "rage",
"rags", "rahs", "raid", "rail", "rain", "rake", "Rama",
"ramp", "rams", "RAMs", "rand", "Rand", "rang", "rank", "rant",
"rape", "raps", "rapt", "rare", "rash", "rasp", "rate",
"rats", "Raul", "rave", "rays", "raze", "razz", "read", "real",
"ream", "reap", "rear", "Reba", "recs", "redo", "reds",
"reed", "Reed", "reef", "reek", "reel", "Rees", "refs", "regs",
"Reid", "rein", "rely", "rems", "Rena", "rend", "Rene",
"Reno", "rent", "reps", "rest", "Reva", "revs", "rhea", "Rhea",
"Rhee", "rhos", "rial", "ribs", "rice", "Rice", "rich",
"Rich", "rick", "Rick", "Rico", "ride", "Ride", "rids", "Riel",
"rife", "riff", "rift", "Riga", "rigs", "rile", "rill",
"rime", "rims", "rind", "ring", "rink", "Rios", "riot", "ripe",
"rips", "rise", "risk", "Rita", "rite", "Ritz", "rive",
"road", "roam", "roan", "roar", "robe", "robs", "Robt", "rock",
"Rock", "rode", "rods", "Roeg", "roes", "roil", "role",
"Rolf", "roll", "Roma", "Rome", "romp", "rood", "roof", "rook",
"room", "root", "Root", "rope", "Rory", "Rosa", "rose",
"Rose", "Ross", "rosy", "rota", "ROTC", "rote", "Roth", "rots",
"roue", "roué", "rout", "roux", "rove", "Rowe", "rows",
"Roxy", "RSVP", "rube", "rubs", "ruby", "Ruby", "ruck", "rude",
"Rudy", "rued", "rues", "ruff", "rugs", "Ruhr", "ruin",
"Ruiz", "rule", "rump", "rums", "rune", "rung", "runs", "runt",
"ruse", "rush", "Rush", "rusk", "Russ", "rust", "Ruth",
"ruts", "Ryan", "Saab", "Saar", "Saba", "sack", "sacs", "Sade",
"Sadr", "safe", "saga", "sage", "sago", "sags", "said",
"sail", "sake", "Saki", "Saks", "sale", "Salk", "salt", "same",
"Sana", "sand", "Sand", "sane", "sang", "Sang", "sank",
"sans", "saps", "Sara", "sari", "sash", "Sask", "sass", "sate",
"Saul", "save", "saws", "says", "scab", "scad", "scam",
"scan", "Scan", "scar", "scat", "Scot", "scow", "scud", "Scud",
"scum", "seal", "seam", "Sean", "sear", "seas", "seat",
"secs", "sect", "seed", "seek", "seem", "seen", "seep", "seer",
"sees", "Sega", "self", "sell", "semi", "send", "sens",
"sent", "Serb", "sere", "serf", "Seth", "sets", "sett", "sewn",
"sews", "sexy", "SGML", "shad", "shag", "shah", "sham",
"shat", "Shaw", "shay", "Shea", "shed", "shes", "shew", "shim",
"shin", "ship", "shiv", "shod", "shoe", "shoo", "shop",
"shot", "show", "shun", "shut", "Siam", "sick", "sics", "side",
"sift", "sigh", "sign", "Sikh", "silk", "sill", "silo",
"silt", "Sims", "sine", "sing", "sink", "sins", "sips", "sire",
"sirs", "Sirs", "site", "sits", "Siva", "size", "skew",
"skid", "skim", "skin", "skip", "skis", "skit", "skua", "Skye",
"slab", "slag", "slam", "slap", "slat", "Slav", "slaw",
"slay", "sled", "slew", "slid", "slim", "slip", "slit", "slob",
"sloe", "slog", "slop", "slot", "slow", "slue", "slug",
"slum", "slur", "slut", "smog", "smug", "smut", "snag", "snap",
"snip", "snit", "snob", "snog", "snot", "snow", "Snow",
"snub", "snug", "soak", "soap", "soar", "sobs", "sock", "socs",
"soda", "sods", "sofa", "soft", "Soho", "soil", "sold",
"sole", "solo", "sols", "some", "song", "sons", "Sony", "soon",
"soot", "sops", "sore", "sort", "Sosa", "Soto", "sots",
"souk", "soul", "soup", "sour", "sous", "sown", "sows", "spam",
"Spam", "span", "Span", "spar", "spas", "spat", "spay",
"spec", "sped", "spew", "spin", "spit", "spiv", "spot", "spry",
"spud", "spun", "spur", "stab", "stag", "Stan", "star",
"stay", "stem", "step", "stet", "stew", "stir", "stop", "stow",
"stub", "stud", "stun", "Styx", "subs", "such", "suck",
"suds", "sued", "sues", "suet", "Suez", "Sufi", "suit", "sulk",
"sumo", "sump", "sums", "sung", "Sung", "sunk", "suns",
"sups", "surd", "sure", "surf", "suss", "Suva", "Suzy", "Sven",
"swab", "swag", "swam", "swan", "swap", "swat", "sway",
"swig", "swim", "swiz", "swot", "swum", "sync", "tabs", "tack",
"taco", "tact", "tads", "Taft", "tags", "tail", "take",
"talc", "tale", "tali", "talk", "tall", "tame", "Tami", "tamp",
"tams", "Tana", "tang", "tank", "tans", "tape", "taps",
"Tara", "tare", "tarn", "taro", "tarp", "tars", "tart", "task",
"Tass", "Tate", "tats", "taus", "taut", "taxi", "teak",
"teal", "team", "tear", "teas", "teat", "teds", "teed", "teem",
"teen", "tees", "tell", "Tell", "tels", "temp", "tend",
"tens", "tent", "Teri", "term", "tern", "Terr", "Tess", "test",
"text", "Thad", "Thai", "than", "Thar", "that", "thaw",
"Thea", "thee", "them", "then", "thew", "they", "thin", "this",
"Thor", "thou", "thru", "thud", "thug", "Thur", "thus",
"tick", "tics", "tide", "Tide", "tidy", "tied", "tier", "ties",
"tiff", "tile", "till", "tilt", "time", "Tina", "tine",
"ting", "Ting", "tins", "tint", "tiny", "tips", "tire", "Tito",
"tizz", "toad", "Toby", "Todd", "toed", "toes", "toff",
"tofu", "toga", "toge", "Togo", "togs", "toil", "Tojo", "toke",
"told", "tole", "toll", "tomb", "tome", "toms", "tone",
"tong", "Toni", "tons", "tony", "Tony", "took", "tool", "toot",
"tops", "tore", "tori", "torn", "tors", "tort", "Tory",
"tosh", "toss", "tote", "Toto", "tots", "tour", "tout", "town",
"tows", "toys", "trad", "tram", "Tran", "trap", "tray",
"tree", "trek", "trey", "Trey", "trig", "trim", "trio", "trip",
"trod", "trot", "trow", "troy", "Troy", "true", "trug",
"tuba", "tube", "tubs", "tuck", "Tuck", "Tues", "tuft", "tugs",
"Tull", "tums", "Tums", "tuna", "tune", "tuns", "Tupi",
"turd", "turf", "Turk", "turn", "tush", "tusk", "tuts", "tutu",
"Tutu", "twas", "twee", "twig", "twin", "twit", "twos",
"tyke", "type", "typo", "Tyre", "tyro", "UCLA", "UFOs", "ugly",
"ulna", "umps", "undo", "unis", "unit", "UNIX", "unto",
"upon", "Ural", "Urdu", "urea", "Urey", "urge", "uric", "Uris",
"urns", "Ursa", "USAF", "used", "user", "uses", "USMC",
"USSR", "Utah", "Utes", "Uzis", "vacs", "vain", "vale", "vamp",
"vane", "Vang", "vans", "vars", "vary", "vase", "vast",
"vats", "veal", "Veda", "veep", "veer", "Vega", "veil", "vein",
"vela", "Vela", "veld", "vend", "Venn", "vent", "Vera",
"verb", "Vern", "very", "vest", "veto", "vets", "vial", "vibe",
"vice", "vied", "vies", "view", "Vila", "vile", "vine",
"vino", "viol", "VIPs", "visa", "Visa", "vise", "vita", "Vito",
"viva", "Vlad", "voes", "void", "vole", "volt", "vote",
"vows", "Waco", "Wacs", "wade", "Wade", "wadi", "wads", "waft",
"wage", "wags", "waif", "wail", "wain", "wait", "wake",
"Wake", "Wald", "wale", "walk", "wall", "Wall", "Walt", "wand",
"wane", "Wang", "wank", "want", "ward", "Ward", "ware",
"Ware", "warm", "warn", "warp", "wars", "wart", "wary", "wash",
"Wash", "wasp", "WASP", "wast", "watt", "Watt", "wave",
"Wave", "wavy", "waxy", "ways", "weak", "weal", "wean", "wear",
"Webb", "webs", "we'd", "weds", "weed", "week", "ween",
"weep", "weer", "wees", "weft", "weir", "weld", "well", "welt",
"wend", "wens", "went", "wept", "were", "west", "West",
"wets", "wham", "what", "whee", "when", "whet", "whew", "whey",
"Whig", "whim", "whip", "whir", "whit", "whiz", "whoa",
"whom", "whop", "whup", "whys", "wick", "wide", "wife", "wigs",
"wild", "wile", "will", "Will", "wilt", "wily", "wimp",
"wind", "wine", "wing", "wink", "wino", "wins", "winy", "wipe",
"wire", "wiry", "wise", "Wise", "wish", "wisp", "wist",
"with", "wits", "Witt", "wive", "woad", "woes", "wogs", "woke",
"woks", "wold", "wolf", "Wolf", "womb", "Wong", "wonk",
"wont", "wood", "Wood", "woof", "wool", "woos", "word", "wore",
"work", "worm", "worn", "wort", "wost", "wove", "wows",
"wrap", "wren", "Wren", "writ", "wuss", "Wynn", "Xian", "Xmas",
"Yacc", "yaks", "Yale", "Yalu", "yams", "yang", "Yang",
"yank", "Yank", "yaps", "yard", "yarn", "yawl", "yawn", "yaws",
"yeah", "year", "yeas", "yegg", "yell", "yelp", "yens",
"yeps", "yest", "yeti", "yews", "yids", "yipe", "yips", "Ymir",
"yobs", "Yoda", "yoga", "yogi", "yoke", "Yoko", "yolk",
"Yong", "yore", "york", "York", "your", "yous", "yowl", "yows",
"yuan", "Yuan", "yuck", "Yugo", "yuks", "yule", "Yule",
"Yuma", "yups", "Yuri", "yurt", "Yves", "Zach", "Zane", "zany",
"zaps", "zeal", "zebu", "zeds", "Zeke", "Zeno", "Zens",
"zero", "zest", "Zest", "zeta", "Zeus", "Zibo", "zinc", "zine",
"zing", "Zion", "zips", "zits", "Zola", "zone", "zoom",
"zoos", "Zorn", "Zulu", "Zuni"}
)];
(*does the search*)
inspect[mat_] := inspect[mat, nextIndices[mat]]
(*finds the indices of the next word to try*)
nextIndices[mat_] /; FreeQ[mat, Verbatim@_] := True
nextIndices[mat_] := nextIndices[mat, indices[mat]]
(*gives all the different groups of positions of words of a matrix of \
a certain size.They are grouped by those that must be the same due to \
the required symmetry*)
i : indices[wordLen_, dims_] :=
i = Permutations[Append[#, All]] & /@
DeleteDuplicates[Sort /@ Tuples[Range[wordLen], {dims - 1}]];
indices[mat_] := indices[Length@mat, Length@Dimensions@mat];
nextIndices[mat_, indices_] :=
nextIndices[mat, indices,
1 + LengthWhile[indices[[All, 1]],
FreeQ[mat[[Sequence @@ #]], Verbatim@_] &]]
nextIndices[mat_, indices_, nextIndex_] := Extract[indices, nextIndex];
inspect[mat_, True] := Throw[mat, tag];
inspect[mat_, indices_] :=
Scan[word |-> inspect[change[mat, word, indices]],
Characters@$random@
Pick[#,
StringMatchQ[#,
StringExpression @@ mat[[Sequence @@ First@indices]]]] &@
dict[Length@mat]]
(*adds the word (as list of characters) to the matrix*)
change[mat_, word_, indices_] :=
Module[{newMat = mat},
Scan[wordPos |-> newMat[[Sequence @@ wordPos]] = word, indices];
newMat]
End[];
findWordHypercube[3, 4]
{{{"i", "d", "e", "a"}, {"d", "e", "a", "l"}, {"e", "a", "r", "l"}, {"a", "l", "l", "y"}}, {{"d", "e", "a", "l"}, {"e", "c", "r", "u"}, {"a", "r", "e", "a"}, {"l", "u", "a", "u"}}, {{"e", "a", "r", "l"}, {"a", "r", "e", "a"}, {"r", "e", "i", "n"}, {"l", "a", "n", "k"}}, {{"a", "l", "l", "y"}, {"l", "u", "a", "u"}, {"l", "a", "n", "k"}, {"y", "u", "k", "s"}}}
I don’t know how to specify a word to make a word cube out of. The Mathematica Language tells us a list of many different words kind of like DictionaryLookup; after all would you rather read through this three-dimensional object with punctuation on top or some function like DictionaryLookup[Repeated[_, {numLetters}]]?
Now we know all these pseudo-random words thanks to the WordCloud Paclet, this must be what you were saying throughout our chats. We’re not allowed to specify a word but we’re allowed to specify random words!







