Repository navigation
Releases: rothos/lexitron
Release list
v5.2.0
ry -S finds words by how they sound, and lx -f/-a letters can go anywhere.
Words by sound
ry -S '.*sigh'gives words ending in the sound of "sigh", however they're spelled: "sigh", "psi", "bonsai".sigh.*starts with it, and.*shun.*has it anywhere.- Words stand for their sounds, so a bare word gives its homophones:
ry -S nightgives "knight" and "nite". .,*,+,?,|,()and{}work as inlx, and ARPAbet works in capitals:ry -S '.* SH AH N'. Stress doesn't count unless you give it (AY1).- A spelling expression and the usual filters narrow the results:
ry -S '.*shun' '.*cian'gives "magician", "musician" and the like.
Letters
-fand-anow take their letters directly, solx '....s' -f jslauy.works likelx -f jslauy. '....s'. Before, the first word was always taken as the letters. Bundles like-rfand-frstill work.- In a terminal, a search with no results says
(no matches)rather than printing nothing.
See the README for more.
v5.1.0
lx -R picks random words.
Random words
lx -Rgives one random word, andlx -R 10gives ten.- It picks from whatever the other options match:
lx -R 5 -l 6 '.*e'gives six-letter words ending in "e", andlx -R 3 -t abbagives words like "boob" and "peep". Letters, Wordle,--plusand the rest work too. - The words are everyday base forms: no plurals or conjugations, and level 50 unless you give
-L. - They come in random order unless you give
-o. With-I, the header says how many matches they were picked from.
See the README for more.
v5.0.0
A new command, ry: a rhyming dictionary, built on the same word list as lx and the CMU Pronouncing Dictionary.
Rhymes
ry catfinds perfect rhymes, grouped by syllables, most common first. Weak rhymes like "bobcat" come last.- Long rhymes, which also match the vowels from the stress before, come first:
ry understandstarts with "wonderland".-gshows only those. -Nnear rhymes, closest first (ry -N love: rough, stuff, enough), and-Aassonance, the same vowels with any consonants (ry -A weblog: headlong, headstrong).-wwrenched rhymes, the same sounds with the stress on one side only (ry -w be: philosophy, democracy;ry -w window: go, below). It combines with-Nand-A.- A word with no perfect rhymes gets near rhymes instead, and one with few gets some near rhymes as well.
Phrases and pronunciations
- Phrases rhyme too:
ry 'hurt you'gives "virtue" and also "alert you", "desert you". - About 220,000 words the dictionary lacks are derived from ones it has ("chasms" from "chasm") or guessed, and guesses are flagged.
- Give a pronunciation in ARPAbet to rhyme it directly:
ry "K AE1 T".
Filters
-ypicks the number of syllables, andlx's expression,-L,-l,-i,-e,-t,-pand-uoptions work the same way:ry -y 2 -L 50 money.
See the README for examples.
v4.1.0
Longer patterns, and fixes from an audit of how the options combine.
Patterns
-tunderstands.*,.+and.?as in regex, so a pattern can match words of any length:lx -t ab.*abfinds "decade", "church" and "alphabetical".
Wordle
- After a poor opener, with thousands of candidates left, guesses are scored against an evenly spaced sample, so results stay quick (a few seconds at worst).
- With
-u, proper and common candidates are scored together, so the bits are right. - Wordle guesses of different lengths, and
--probeswith-o, are now errors instead of being ignored.
Speed
-o beststops with an error on lists over 5000 words instead of running for minutes.-nskips sorting, so counts are faster.
See the README for examples.
v4.0.0
New filters, a proper Wordle solver, and tools for Scrabble and word ladders.
Breaking changes
-inow means--include(see below). The info header is-I.- Blank tiles in
-fand-aletters are.only, matching what.means in expressions and patterns:lx -a dot..?is no longer accepted. - The old option names
--only-phrasesand--only-uppercaseare gone; use--phrases-onlyand--uppercase-only.
New filters
-i/-e: words that contain all of these letters / none of them. Repeats count, so-i eemeans at least two e's:lx -i q -e u-t: patterns, where each letter stands for some letter:lx -t abbafinds "deed" and "noon",lx -t abcdcbafinds "racecar" and "deified"- The expression can be left out when another option says what to look for.
Word games
-w: Wordle. One per guess, withg,yor.for each letter:lx -w crane:..y.g -w toils:.y.... The best next guesses come first, with how much each would tell you, in bits. Guesses that can't be the answer but would narrow things down more are listed first, dimmed.--probeslists only those: the best and worst 20.--plus,--minus,--change: words one letter away (or N, withcat:2), for word ladders and the like:lx --change love--hooks: Scrabble hooks:lx --hooks atshowsbcefghklmoprstvw at e- New sort order
-o best: best Wordle guess first (the default with-w).
Other changes
- Shorter help, with the options in a more sensible order.
- The
-Iheader mentions the length when-lis given.
See the README for examples.
v3.3.1
v3.3.0
Consistent phrases.
Word list
- Phrases with spaces are now listed in their base form only: "sperm whale", not "sperm whales". SCOWL gives plurals for only a few phrases ("sperm banks" but not "sperm cells"), so the 5,462 inflected phrases are left out for consistency.
- Hyphenated words keep their inflected forms ("x-rayed", "to-dos"). Single words are unchanged.
See the README for details.
v3.2.0
Phrases only.
New option
-Psearches only phrases and hyphenated entries:lx -P 'sperm.*'gives "sperm bank", "sperm whale" and so on, without "sperm" or "spermicide".-pstill adds phrases to the usual results; the two can't be combined.- From Python:
search(..., phrases=True, single_words=False).
See the README for details.
v3.1.0
Word families and color.
New default sort
- Results are still alphabetical, but inflected forms now come right after their base form:
run ran running runs runabout. Use-o alphafor the old strict alphabetical order (this also applies to piped output).
Styled terminal output
- Inflected forms listed under their base form are dimmed, so each family stands out.
- Other words are colored by how common they are: bold green for core vocabulary, then green, yellow and orange, to red for the most obscure.
- Set
NO_COLORto turn styling off. Piped output is never styled.
See the README for details.
v3.0.0
A big update: a new word list, whole-word matching, and tools for word games (anagrams, letter racks with blank tiles, Spelling Bee, Wordle).
Breaking changes
- Expressions now match the whole word. In 2.x,
lx catmatched any word containing "cat"; to get that behavior now, uselx -s cat. - Inflected forms (plurals, conjugations, etc) are now searched too; use
-bto search base forms only, as in 2.x. - New word list: SCOWL replaces AGID, so results differ. It adds everyday words AGID was missing ("a", "of", "from"), British and other spellings, and obscurity levels. The default level (
-L 70) leaves out very obscure words; use-L 95to search everything. - Requires Python 3.9 or later.
New options
-f/-a: words spelled from given letters / exact anagrams, with-rto reuse letters and?or.as blank tiles:lx -a 'retain?'-l: length (5,4-7,5-);-o: sort bylengthorcommon;-L: obscurity level;-p: phrases like "sperm whale";-c: case-sensitive- Options can go anywhere on the command line.
Fixes
- Output no longer crashes when piped or redirected; it falls back to one word per line.
- Invalid regular expressions give a short error instead of a traceback.
- Apostrophes in expressions are no longer stripped.
-iwith-nprints the header line;-uand-Ucan no longer be combined.
Lexitron can also be used as a Python library: from lexitron import search. See the README for examples.