mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
use map in extract to fix a unordered bug in different environment , by the way, it improves 1/6 speed
This commit is contained in:
parent
90d2280002
commit
e3b58d6ddc
@ -112,13 +112,13 @@ namespace CppJieba
|
||||
}
|
||||
}
|
||||
|
||||
unordered_map<string, double> wordmap;
|
||||
map<string, double> wordmap;
|
||||
for(uint i = 0; i < words.size(); i ++)
|
||||
{
|
||||
wordmap[ words[i] ] += 1.0;
|
||||
}
|
||||
|
||||
for(unordered_map<string, double>::iterator itr = wordmap.begin(); itr != wordmap.end(); )
|
||||
for(map<string, double>::iterator itr = wordmap.begin(); itr != wordmap.end(); )
|
||||
{
|
||||
if(_blackSet.end() != _blackSet.find(itr->first))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user