Xavier's Anagram Solver

Xavier's Anagram Solver is my take on an anagram solver. It is written in PHP and uses a MySQL back-end to store a huge dictionary of words. This makes it possible to solve an anagram of over 150,000 english and 180,000 dutch words. Solving takes only a split second. That's the results of clever programming.

You might ask yourself: Why would you want to build an anagram solver? Well, a friend challenged me and said I couldn't do it. Enough said!

How Solving Works

Anagrams are essentially scrambled words. For example: 'ragaman' is an anagram for 'anagram'. All the letters of anagram are in 'ragaman'. The only difference is the position of the letters.

In other words, if you can re-arrange the letters of the anagram in a way that they would always match the same word, you could find the solution! For example: 'ragaman' or 'mnagraa' are both anagrams for 'anagram'.

So how do you re-arrange the letters? In alphabetic order of course! Example: 'ragaman' would become 'aaagmnr'. If you alphabetically re-arrange the letters of any other anagram for 'anagram', you would become the same, 'aaagmnr'

The rest is very simple. The database contains a huge dictionary with normal words. Next to each normal word is the alphabetically re-arranged version. So next to 'dog' stands 'dgo'.

When you enter an anagram, the solver re-arranges the letters of your anagram and finds a word that matches this combination.

That's it! My approach of an anagram solver is only limited to the dictionary you use it with. You have a higher chance of solving an anagram with a big dictionary then with a small one.

Feedback, source & demo

If you have any suggestions for my anagram solver, please let me know!

Want to see the anagram solver in action? Visit: anagram.savjee.be

Source code is available on Github: https://github.com/Savjee/Xavier-s-Anagram-Solver