Create a dictionary from words mapped to unique numbers, and use this what you can best do.
I doubt that there are more than 2 ^ 32 numbers of words used, but this is not the problem you are facing, the problem is that you need to map the numbers back to words.
If you only match words with numbers, some hashing algorithm may come up, although you have to work a bit to ensure that you have one that will not create collisions.
However, for numbers turned to words, this is a completely different problem, and the simplest solution for this is to simply create a dictionary and display both methods.
In other words:
AARDUANI = 0 AARDVARK = 1 ...
If you want to match numbers with 26 base characters, you can save only 6 characters (or 5 or 7 if I miscalculated), but not 12 and, of course, not 20.
Unless you count only actual words and they do not follow any good counting rules. The only way to do this is to simply put all the words in a long list and start assigning numbers from the very beginning.
source share