Find path from one word to another, changing one letter each step, and
each intermediate word must be in the dictionary, the dictionary is a
text file with words separated by a line break like the one found in
/usr/share/dict/words
- Python 3.4 and Linux
- List of words separated by newlines
- Virtual environment is recommended
$ pip install word-ladder
Clone the repository (Pypi package comming soon)
$ git clone git@github.com:snebel29/word_ladder.git
$ cd word_ladder
$ pip install .
to install development dependencies as well
$ pip install -e .[dev]
The word_ladder packges commes with both, a command line tool and a module that can be used to find word ladder paths
Once installed you can use the command line interface
$ word_ladder -h
You can import and use the module directly as well
>>> from word_ladder import WordLadder
>>> wl = WordLadder('tests/word_lists/linux_english_words')
>>> wl.find_path('fear', 'sail')
['fear', 'hear', 'heir', 'hair', 'hail', 'sail']
>>> wl.find_path('Abe', 'sail')
['Abe', 'be', 'bed', 'bid', 'aid', 'said', 'sail']
>>> wl.find_path('Am', 'sail')
['Am', 'am', 'aim', 'ail', 'sail']
You will have to use nose to run the tests
$ nosetests
Clone development branch then create pull requests against it