mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
Merge branch 'dev' into less_memory
This commit is contained in:
commit
0e33a0a570
@ -1,3 +1,7 @@
|
||||
## v2.3.5 is coming
|
||||
|
||||
1. 适配低级版本的`g++`,已在`g++ 4.4.7`上测试通过。
|
||||
|
||||
## v2.3.4
|
||||
|
||||
1. 修改了设计上的问题,删除了`TrieManager`这个类,以避免造成一些可能的隐患。
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
### 依赖
|
||||
|
||||
* g++ (version >= 4.6 recommended);
|
||||
* g++ (version >= 4.4.7 recommended);
|
||||
* cmake (version >= 2.8 recommended);
|
||||
|
||||
### 下载和安装
|
||||
|
@ -136,21 +136,10 @@ namespace CppJieba
|
||||
size_t now, old, stat;
|
||||
double tmp, endE, endS;
|
||||
|
||||
try
|
||||
{
|
||||
path = new int [XYSize];
|
||||
weight = new double [XYSize];
|
||||
}
|
||||
catch(const std::bad_alloc&)
|
||||
{
|
||||
LogError("bad_alloc");
|
||||
return false;
|
||||
}
|
||||
if(NULL == path || NULL == weight)
|
||||
{
|
||||
LogError("bad_alloc");
|
||||
return false;
|
||||
}
|
||||
path = new int [XYSize];
|
||||
assert(path);
|
||||
weight = new double [XYSize];
|
||||
assert(weight);
|
||||
|
||||
//start
|
||||
for(size_t y = 0; y < Y; y++)
|
||||
|
@ -84,7 +84,7 @@ namespace CppJieba
|
||||
{
|
||||
if(_stopWords.end() != _stopWords.find(itr->first))
|
||||
{
|
||||
itr = wordmap.erase(itr);
|
||||
wordmap.erase(itr++);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -77,8 +77,9 @@ namespace CppJieba
|
||||
_minLogFreq = MAX_DOUBLE;
|
||||
_setInitFlag(false);
|
||||
}
|
||||
Trie(const string& filePath): Trie()
|
||||
Trie(const string& filePath)
|
||||
{
|
||||
Trie();
|
||||
_setInitFlag(init(filePath));
|
||||
}
|
||||
~Trie()
|
||||
|
@ -84,7 +84,8 @@ bool run(int argc, char** argv)
|
||||
}
|
||||
|
||||
int pid = getpid();
|
||||
string pidStr = to_string(pid);
|
||||
string pidStr;
|
||||
string_format(pidStr, "%d", pid);
|
||||
loadStr2File(val.c_str(), ios::out, pidStr);
|
||||
LogInfo("write pid[%s] into file[%s]", pidStr.c_str(), val.c_str());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user