Word Lists & Scoring¶
blacksquare includes a high-performance word list engine capable of matching patterns and calculating crossing letter frequencies in microseconds.
Embedded Default Word List¶
The default word list contains 304,661 scored English words (from the open SpreadTheWordlist corpus) compiled directly into the binary:
from blacksquare import DEFAULT_WORDLIST
print(f"Total words: {len(DEFAULT_WORDLIST):,}")
print("Top sample words:", DEFAULT_WORDLIST.sample(5))
Custom Word Lists¶
You can construct a WordList from Python lists, dictionaries, or text files:
Pattern Matching¶
Find matches for words with wildcards (?, , _):
matches = DEFAULT_WORDLIST.find_matches("C??S")
print(matches.words[:10]) # ['CATS', 'COWS', 'CARS', ...]