c++ - Multimap insertion crashes after 1 insert -
i writing program spellchecker, implements crude version(for simplicity) of soundexing incorrectly spelled word.
goal: while iterating set, holds words in dictionary, soundex code generated, inserted multimap soundex being key, , word dictionary being associated data.
issue: after loop iterates once, program crashes. have narrowed down issue being actual insertion itself.
note: d pointer holds multimap. multimap sndxmap;
code:
replacementchooser::replacementchooser(const dictionaries& dictionary) { //loop through dictionary, giving word extendedsoundex for(dictionaries::iterator = dictionary.begin(); it!=dictionary.end();it++) { string code = extendedsoundex(*it,-1); d->sndxmap.insert(multimap<string,string>::value_type(code,*it)); //crashes }
}
Comments
Post a Comment