Probably an example will be easier to explain this.
So imagine i have something like this:
word_dict = {"word": frequency}
example would I loop thru a paragraph and in that paragraph I found the word freq as
word_dict = {"this":2,"that":4} # assume that all the cases have just these two words..
yepp its a strange dict..
Now, each paragraph is assigned to a story and this story has an id:
lets say i get this:
{1234: {word_dict}} # where 1234 is the story id
and then this story is contanined in a book:
So if do something like book_dict[book_id][story_id], this would return me word_dict.
But there is a good chance that a same book_id, story_id will have different word_dict
i Know it sounds weird..
So what I want is that book_dict[book_id][story_id] = [{word_dict}] so it returns me a list of word dictionary..
How do I implement this.
Err. is the question making any sense?
1 Answer