Sunday, May 25, 2008

Anagram Generation (CSE)

by Your Name 0 comments



Share this post:
Design Float
StumbleUpon
Reddit

ANAGRAM:
An anagram is a rearrangement of the letters of one word or phrase to form another word or phrase.
AIM:
Generation of an anagram by the user for the specified word, which is presented as an input to the program.
SCOPE
1 Astronomy
2 Pseudonyms
3 Anagrammatic Poem
4 Dictionaries
5 Scrabble game and puzzles
6 Security reasons
What is the point of anagrams?
Essentially, anagramming is a recreational activity. Great pleasure can be obtained when one finds a witty anagram in someone's name. We will often find the 'hidden truth' in an anagram of a person's name:
Matthias N. Ritchie. = I am the Antichrist! (Mick Tully, 1998)
A 'visitor' to alt.anagrams presented the above false name for anagramming. Practical joking is not unknown in alt.anagrams .
An important aim is to find a relevant or apt anagram that is amusing, poignant, or abusive in content, and one that either paraphrases the original text or creates an 'antigram', an anagram with the opposite meaning to the subject text.
Occasionally anagram puzzles are presented to be solved, e.g., a book title and author. It is a great feeling when you crack the code.
Topical anagrams from current events are frequently a source of interest. For example:
Bosnian War Crimes. = Serbian racism won. (Tom Myers, 1999)
Whitehouse Intern Miss Monica Samille Lewinsky = Hey! William Clinton arouses me. Hi! I'm Ken's witness! (William Tunstall-Pedoe, 1998)
Occasionally this newsgroup is belittled by outsiders who think that it is all a waste of time and that we 'are stupid geeks and should get a life'. Such criticism is dealt with in our usual way. We anagram the crap out of the critic!
How do you create anagrams?
There are two basic ways: Manually or with an anagram generator program.
The main advantages of using a computer program are speed and the generator's dictionary. They will generate hundreds or thousands of anagrams in a minute or two. Most will be meaningless, and one has to wade through them, find the most appropriate combinations of words, arrange the words, etc.
There has been debate in the group as to whether using an anagram generator is 'cheating'. Sometimes, generators will quickly reveal a great anagram, but there is always a modicum of luck and a lot of skill needed to find the best anagrams. The consensus here is that it is not cheating. Programs have also been written that juggle items in a long list (recording artists, aphorisms, etc.) between the 'left' and 'right' side until an anagram is formed; while opinions vary as to the artistry and merit of anagrams generated in this way, there is room in the group for such anagrams and civil discussion of them.

PLATFORM USAGE:
Many questions arise on the basis of why this anagram implementation has been done in perl and not in some other language.
The answer to it is explained with reasoning as follows:
As implemented in c/c++:
The coding requires:
1. permutation.c
2. stack.h
3. data.h
4. dictionary.c
5. fuse.c
its overview is presented down below:

1 permutation.c
this consists of the coding which is performed using recursive backtracking of the given input .Its the main module in the anagram implementation because in this module we include
stack.h
data.h
here we traverse through all the possible words which can be formed with the given input. It results in giving an output which consists of all the possible permutations of the input and this is what is presented to the user.
2. dictionary.c
As the word suggests, this is the module which takes care of the traversal of the whole dictionary which is nothing but a file full of the all the possible text accumulated by the programmer.
Here we make the general usage of
Linked list concept and files concept
This serves the purpose of searching a word and letting the user know whether the word which is being searched for is present in the dictionary.
3. Fuse.c
This is the final module which results in the fusing of the above two module explained. This takes in the output of the permutation.c and gives it as an input to the dictionary.c and after checking the dictionary for each and every permuted word. The result is show to the user whether the word is present of not. If the word is present then anagram found or else not found.

4.Resultant:
1. very lengthy program.
2. Usage of a lot of concept.
3. lot of modular division
4. Fault finding becomes difficult
5. Increase in lines of code
6. Implements slow algorithm(searching each permuted word in dictionary)
PLATFORM :ACTIVEPERL
Reason behind this particular language:As logically implied in the explanation that the c/c++ languages which are conventionally good and considerable easy to understand are really difficult to be made use of and implemented for the purpose of anagram generation.
CONCLUSIONS:
1. Permutation of the given input
2. Dictionary file implementation
3. For the given input the output has been successfully generated and shown as an anagram. Hence fulfilling the requirements of generating a anagram

The documentation for this project can be seen below

Read this doc on Scribd: anagram gen

Comments 0 comments

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Subscribe feeds rss Recent Entries

Advertise on this site Sponsored links

Categories

Subscribe feeds rss Recent Comments

Technorati

Technorati
My authority on technorati
Add this blog to your faves