Lexeme
CLI to play a word-guessing game like Wordle (https://www.powerlanguage.co.uk/wordle)
Install / Use
/learn @dlenski/LexemeREADME
Lexeme
What is this?
Python program to play a word-guessing game like Wordle, but…
- More addictive because you can play it over and over and over, not just once a day.
- Option for varying the word length (
-l,--length) or number of guesses (-g,--guesses) - Option to allow guesses that aren't known words (
-n,--nonsense) - Option to do guess-by-guess analysis, showing how many words you eliminate after each guess (
-a,--analysis) - Option to show time taken after every guess (
-t,--timer) - A bunch of unit tests to verify the logic
- Beautiful command-line text interface (😜)
Running it
Installation
Requires Python 3.x, the colorama module
for printing colored letters, and a file containing a list of possible
words.
Install with pip3 install https://github.com/dlenski/lexeme/archive/main.zip, then play the game with the command lexeme.
Wordlists
The default wordlist is taken from /usr/share/dict/words, which
should exist on any desktop Unix system.
Collins Scrabble Word Lists
The Collins Scrabble Word Lists seem to work nicely! The 2019 edition (CSW2019) contains 12,972 five-letter words, which are precisely the same as the valid guesses in Wordle itself.
Word lists for French, Spanish, and German
The project lorenbrichter/Words contains high-quality French, Spanish, and German wordlists used for other word games.
Diacritics have been removed (e.g. français → francais and hablé → hable),
and as far as I can see, all of the possible inflected verb forms are included
for French and Spanish. Should be very playable with Lexeme!
Wordle word lists
UPDATE: Wordle frequently updates its minified .js files, but the basic
idea should stay the same: there are two arrays in the source, one of which
contains all the answers and one of which contains all the other words
allowed as guesses.
The wordlists used by Wordle itself are a bit unusual: Wordle has a short list of words as possible answers (2,315 words), but a much longer list of additional words as allowed guesses (10,657 additional words). They can be extracted with, say, these horrible cURL+Perl one-liners:
curl https://www.powerlanguage.co.uk/wordle/main.c1506a22.js |
perl -ne 'print join("\n", ($1=~/\w+/g)) . "\n" if /La=(\[[^]]+\])/' > wordle_possible_answers.txt
curl https://www.powerlanguage.co.uk/wordle/main.c1506a22.js |
perl -ne 'print join("\n", ($1=~/\w+/g)) . "\n" if /Ta=(\[[^]]+\])/' | cat wordle_possible_answers.txt - > wordle_allowed_guesses.txt
The combined 12,972 words allowed as guesses in Wordle precisely match the 12,972 five-letter words in CSW2019 (the 2019 edition of the Collins Scrabble Word List).
Options
usage: lexeme [-h] [-d DICT] [-g GUESSES] [-l LENGTH] [-n] [-a]
optional arguments:
-h, --help show this help message and exit
-d DICT, --dict DICT Wordlist to use, either an absolute path or a path
relative to /usr/share/dict. Default
/usr/share/dict/words.
-g GUESSES, --guesses GUESSES
Maximum number of guesses to allow
-l LENGTH, --length LENGTH
Length of word to guess
-n, --nonsense Allow nonsense guesses. (Default is to only allow
known words.)
-a, --analyzer Analyze remaining possible words, and show their
number after each guess. If repeated (cheater mode!),
it will show you all the remaining possible words when
there are fewer than 100
-t, --timer Show time taken after every guess.
-D, --strip-diacritics
EXPERIMENTAL: Strip diacritics from words (should
allow playing with Spanish/French wordlists)
Screenshots
Example of gameplay, with analyzer (-a) and timer (`-t) enabled,
showing you the number of possible remaining words, and the time taken
for each guess:

Example of cheater mode (-aa), show you all of the possible remaining words
after each guess, as long as there are ≤100 of them:

Inspiration
- Wordle, of course
- @jsha's brilliant Wordlyze (source for the analyzer mode
- The subtle handling of repeated letters inspired the unit tests
Related Skills
node-connect
351.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
