Home / Version 0.0.x (Really Old)
Name Modified Size InfoDownloads / Week
Parent folder
Anagram with menu.py 2010-02-26 15.5 kB
Anagram.py 2010-02-26 11.3 kB
Readme.txt 2010-02-26 5.5 kB
Totals: 3 Items   32.3 kB 0
===========                                                                                           ===========
===========                                      READ ME:                                             ===========
===========                                                                                           ===========
BEFORE STARTING: ENSURE THAT Dict.txt IS IN THE SAME FOLDER AS THE SCRIPT YOU ARE RUNNING OR IT WILL NOT
RUN CORRECTLY.

NOTE: If you use the "Python with Menu" form of this program, you can essentially ignore what's below.
Just run the module in the python shell and everything from there should be straight forward.



To use this program, open the python shell and run the module. All of the things this program can do are
written as specific functions which are outlined below. To invoke one of them, simply type everything
between the quotes and hit enter. The function will prompt you for a string and then run:

"lettersinword()" - This function finds words that contain all of the letters in the string that you
you input at the beginning.

"stringinword()" - This function finds words that contain all of the letters in your string back to
back. For example, a search on the string "THE" will turn up "FIGHTER" but not "THREE" because in the
word "THREE" the letters in "THE" aren't all back to back. However, the function "lettersinword()" will
indeed turn up the word "THREE" because it doesn't take into account the locations of the letters within
the word relative to each other.

"wordinstring()" - This function finds words that can be made with some or all of the letters in your
string.

"fullstringmatch()" - This function will find all the words that can be made using all and only all of
the letters in the string the user inputs.

"testthisspelling()" - This function will find all of the closest matches to the input of the user
and display them. Words are scored using their Levenshtein distance from the input string. For every
deletion, insertion, or changing of a letter within the string to make it like the other, the Levenshtein
distances goes up by one. For example the distance between "THIS" and "TIPS" would be 2 (one to change
the H to the I, and one to change the I to a P).

"endsin()" - This function finds words that end in the user specified string.

"containsstr()" - Finds words that contain an exact string.

"crosswerd()" - A crossword fuctionality. Enter strings using '-' or '?' for unknown letters. For example
entering 'he--o' will output words like 'hello'.



The dictionary used to run this program was taken from Facebook's puzzles section. A link to that puzzle
can be found here (a link to the text file can be found within the text here):

http://www.facebook.com/careers/puzzles.php?puzzle_id=17





===========                                                                                           ===========
===========                                     CHANGE LOG:                                           ===========
===========                                                                                           ===========

PLEASE NOTE -- This change log is meant to serve as a reference only. It is by no means complete and many
of the minor tweaks that were done while I sat bored in class were not included.

v0.0.1 - Two major functions created (spell checker and string-in-word). UI relied on user to execute the
functions within python shell after running the module. Program relied on only one python file which was
unpackaged. All around not ready for release.

v0.0.2 - Added a basic menu structure using "while" loops that allowed the user to actually navigate the
functions. Added descriptions for the functions. [NOTE: THIS WAS LATER REMOVED].

v0.0.3 - Added two more functions (full-string-match and word-in-string). Removed the basic menu system
for now. Planning on redoing it to include these two functions.

v0.0.4 - Added "failer" to the functions to print an output if no matches are found. Also added code to
list all of the best matches for spell-checker instead of simply the best match which appears first
alphabetically. Plans for a GUI using Tkinter in the works. Nothing fancy, but probably won't be released
until v0.1.x which won't be ready for a while.

v0.0.5 - [FEB 08, 2010] -- Functions endsin() and containsstr() were added. Started adding comments to the code.
Implemented similar code from spell-checker to allow wordinstring() to output a list of the longest possible
words that can be created using only the letters in used input. Function names will now be referred to as
they are in the module.

v0.0.6 - [FEB 09, 2010] -- Realized there was a huge issue with the algorithms for some of the functions. For
example, the stringinword() function would only return words with the letters in one grouping. A search on the
string "THE" found the word "FIGHTER" but not the word "THREE" because in the word "THREE" the letters are not
grouped together back to back. Fixed this by adding functions that solved for this while keeping the old ones.
They still may retain some utility.

v0.0.7 - [over the course of a few days] -- added a menu interface within the python shell. Should make things
easier so that users don't have to constantly refer to the readme.

v0.0.8 - [FEB 25, 2010] -- Added crosswerd().
Source: Readme.txt, updated 2010-02-26