CCXXV is a crossword assistant, intended to help you find the right word to fill out your missing squares.
In addition to the normal functionality to help fill out a single answer, it can also help in those tricky corners where you have two clues that cross on an unknown letter.
To find a word with missing letters, use ‘.’ to represent any missing letters:
$ ccxxv ba..na
banana
To find a pair of words that cross on an unknown letter, use ‘+’ to represent the crossing letter:
$ ccxxv ba+.na u+cle
n
banana uncle
These commands use the default wordlist, UKACD. To use a different wordlist, pipe it to stdin:
$ echo xxx | ccxxv ...
xxx
CCXXV is 225 in Roman numerals. Crosswords typically occupy a 15x15 grid, 15x15 is 225 and Roman numerals are a common device in crosswords (e.g. “Drink for about 50 notes (3)”, ALE).
The default word list is UKACD 2009, Copyright (c) 2009 J Ross Beresford, All rights reserved.
This is a wordlist designed for crosswords, and contains commonly used phrases and Proper Nouns.
A crossword solving assistant.
| Parameters: |
|
|---|
If neither parameter is specified, the solver uses the UK Advanced Cryptics dictionary by default. This dictionary contains various proper nouns common in crosswords as well as words normally considered legal in word games such as Scrabble.
>>> Solver().solve_single_word('Aachen')
['Aachen']
Other wordlists may be specified in the same format as UKACD, a string with one entry per line.
>>> s = Solver(wordlist='Hello\nWorld')
>>> s.solve_single_word('.....')
['Hello', 'World']
Alternatively the wordlist_name argument can be used to load a wordlist from the wordlists directory
>>> s = Solver(wordlist_name='sample')
>>> s.solve_single_word('.....')
['Hello', 'World']
| Parameters: | pattern – an answer pattern. missing letters are indicated by ‘.’ |
|---|---|
| Returns: | A list of words that conform to that pattern. |
Traditional crossword pattern solver behaviour - Given a pattern, returns all words that fit that pattern.
>>> s = Solver()
>>> s.solve_single_word('.ylophone')
['xylophone']
Capitalisation is not important.
>>> s.solve_single_word('a.ron')
['Aaron', 'Akron', 'apron']
>>> s.solve_single_word('A.ron')
['Aaron', 'Akron', 'apron']
Patterns may include spaces, and spaces will be matched.
>>> s.solve_single_word('a.andon s.ip')
['abandon ship']
However, a space won’t be matched as an unknown character
>>> s.solve_single_word('abandon.ship')
[]
The same is true for hyphens
>>> s.solve_single_word('abat-.our')
['abat-jour']
>>> s.solve_single_word('abat.jour')
[]
There is no requirement that any letters are known or not known
>>> s.solve_single_word('Aachen')
['Aachen']
>>> s.solve_single_word('........................')
['Aldiborontiphoscophornia', 'hydrochlorofluorocarbons']
| Parameters: |
|
|---|---|
| Returns: | A list of words that conform to that pattern. |
Given two patterns that cross on an unknown letter (marked as ‘+’ in the patterns), returns a dictionary where the keys correspond to the crossing letter and the values is a tuple containing a list for each pattern
>>> s = Solver()
>>> s.solve_word_pair('+oology', 'ad+e')
{'z': (['zoology'], ['adze'])}
The first ‘column’ matches the first argument, the second matches the second.
>>> s.solve_word_pair('ad+e', '+oology')
{'z': (['adze'], ['zoology'])}
‘.’ indicates a missing character, just as in a single-word query.
>>> s.solve_word_pair('z+olo..', '.uin+a')
{'o': (['zoology'], ['quinoa'])}
Capitalisation needn’t match on the crossing letter.
>>> s.solve_word_pair('+aron', 'b+ron')
{'a': (['Aaron'], ['baron'])}
A crossing character is required on both arguments
>>> s.solve_word_pair('.aron', 'baron')
Traceback (most recent call last):
...
ValueError: Both arguments need a crossing character "+"
Spaces are respected.
>>> s.solve_word_pair('a.andon s.i+', '+ies')
{'p': (['abandon ship'], ['pies'])}
If no words can be found, an empty dictionary is returned:
>>> s.solve_word_pair('xyzz+', '+ellow')
{}
>>> s.solve_word_pair('+ellow', 'x+zzy')
{}