hi, everyone ,I have a map<string ,int > innermap, and put it in a map, map<string, innermap> outtermap, now I put word/tag/number in it ,tag is the characteristic or property of a certain word, number is how many times the pair (word , tag) have shown, but one word can have several tag, now I have a word, let's call it 'firstword' , how can I find every number in the innermap by the 'firstword'
.thank you.
ok, say , for the word "fly" , there are two tag, V and N , and when fly used as a verb , it appears 35 times , and as a noun , it appears 150 times, so fly/verb/35, and fly/noun/150, are stored, now I have the word "fly", how to find the value 35 and 150 in the map ,respectively
struct WordUsed
{
int asNoun;
int asVerb;
};
std::map< std::string, WordUsed > yourmap;
yourmap["fly"].asNoun += 1;
EDIT:
If the tags have to be dynamic, that gets a little trickier. You could use a map of a map... or you could use a map with a tuple key instead of a string.