This is a general cryptic crossword clue solver, written in Python
Required python packages:
The easiest way to install the correct version of all the required packages is:
Optionally, create a new virtual environment so that your system python isn't affected:
pip install virtualenv virtualenv env source env/bin/activate
Install all required python packages:
pip install -r requirements.txt
python (tested with 2.7) rake
Clone this repository somewhere convenient, then
cd to the folder containing this file.
Run this command to download the python NLTK Wordnet corpus from http://nltk.org/data.html:
Generate the n-grams and synonyms datasets by running
in the main cryptics folder (this will take a few minutes to finish).
Web interface: http://localhost:8080/
Test cases (requires the python nose package):
For each clue, you must give the number of letters in the answer, and you may give a letter pattern for the answer to follow, where a '.' represents an unknown letter (ignoring spaces). For example:
Initially babies are naked (4)
Lees horse galloping to dangerous_coasts (3,6) l.....r..
You can give the solver a hint that a set of words form a phrase (and need not be treated separately) by combining them with an underscore (as in 'dangerous_coasts' above).
The output is given both as a hierarchical representation of the clue structure and as a natural-language description:
100%: (top (sub (sub_ "initially") (lit "babies") -> B) (lit "are") (d "naked") -> BARE) 'initially' means to take a substring of 'babies' to get B. 'naked' is the definition. Combine 'b' and 'are' to get BARE. BARE matches 'naked' with confidence score 100%.
90%: (top (lit "lees") (ana (lit "horse") (ana_ "galloping") -> HORES) (d "to_dangerous_coasts") -> LEE_SHORES) 'galloping' means to anagram 'horse' to get HORES. 'to_dangerous_coasts' is the definition. Combine 'lees' and 'hores' to get LEE_SHORES. LEE_SHORES matches 'to_dangerous_coasts' with confidence score 90%.
Interacting with the solver
Here's a demo of more ways you can play with the solver interactively: cryptic_demo.ipynb
To learn more about how the solver works, see this blog post: http://blog.robindeits.com/2013/02/11/a-cryptic-crossword-clue-solver/.
In addition, it uses the UK Advanced Cryptics Dictionary, Copyright (c) 2009 J Ross Beresford. For license information see
Indicator word lists are from: http://sutherland-studios.com.au/puzzles/anagram.php http://www.crosswordunclued.com/2008/09/dictionary.html