asrayousuf / ScrabbleWordRecommender

0 stars 0 forks source link

Create anagram map from the dictionary #17

Closed aravindsrivats closed 9 years ago

aravindsrivats commented 9 years ago

Creating the anagram map from the dictionary file to store all words in the format: key = anagram string ; value = all possible strings with that anagram

aravindsrivats commented 9 years ago

We are using a anagram map to store the words @asrayousuf @aravindram94 so that we don't have to compare the same words twice.

nsparatkar commented 9 years ago

@aravindsrivats : The key should be the sorted lettered word!

aravindsrivats commented 9 years ago

Yes. That will be the key. The value will be a list of words and the score.

nsparatkar commented 9 years ago

@aravindsrivats : At which position is the score going to be?

aravindsrivats commented 9 years ago

I'll return you the Word object in which, the word will be each word separated by spaces and score as its common score.

nsparatkar commented 9 years ago

@aravindsrivats : Why a space separated list? You can have a list. It becomes easier to compute.

aravindsrivats commented 9 years ago

Compute what? The score is going to be calculated using the key.

nsparatkar commented 9 years ago

@aravindsrivats : is there an element names score in the object? Or is it going to be appended to the list in the map?

aravindsrivats commented 9 years ago

This is the final structure. Map < String, String>
Key will be sorted word. Value will be "score anagram1 anagram2 anagram3 . . " If there is no anagram Value will be "score"

aravindram94 commented 9 years ago

It cant be . bcoz after sorting u lose the word . so u cant store the score alone

aravindsrivats commented 9 years ago

Sorry. It will be "score word"

aravindram94 commented 9 years ago

But the whole point is why do u bother about the traversing the list ! it is a performance issue man! So performance doesnot matter...

aravindsrivats commented 9 years ago

Its not about performance. Its about stupidity. Why go over the same set of characters again and again?

aravindram94 commented 9 years ago

okay!

aravindram94 commented 9 years ago

can v discuss about the signature of the function?

aravindsrivats commented 9 years ago

Map of the following structure is generated. Map <String, String>