mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
bak befor replace unicode with utf8
This commit is contained in:
parent
140ce134b6
commit
3da92a2e1a
2
Trie.cpp
2
Trie.cpp
@ -188,7 +188,7 @@ int main()
|
|||||||
//ChUnicode chUniStr[16];
|
//ChUnicode chUniStr[16];
|
||||||
//int uniLen = utf8ToUnicode(utf, sizeof(utf), chUniStr);
|
//int uniLen = utf8ToUnicode(utf, sizeof(utf), chUniStr);
|
||||||
//cout<<trie.find(chUniStr, uniLen)<<endl;
|
//cout<<trie.find(chUniStr, uniLen)<<endl;
|
||||||
char utf[1024] = "我来到北京清华大学";
|
char utf[1024] = "我来到北京清华大学3D电视";
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
ChUnicode chUniStr[1024];
|
ChUnicode chUniStr[1024];
|
||||||
//cout<<sizeof(utf)<<endl;
|
//cout<<sizeof(utf)<<endl;
|
||||||
|
4
Trie.h
4
Trie.h
@ -19,10 +19,11 @@ namespace CppJieba
|
|||||||
typedef uint16_t ChUnicode;
|
typedef uint16_t ChUnicode;
|
||||||
typedef map<ChUnicode, struct TrieNode*> TrieNodeHashMap;
|
typedef map<ChUnicode, struct TrieNode*> TrieNodeHashMap;
|
||||||
|
|
||||||
struct TrieNode
|
struct TrieNode
|
||||||
{
|
{
|
||||||
TrieNodeHashMap hmap;
|
TrieNodeHashMap hmap;
|
||||||
bool isLeaf;
|
bool isLeaf;
|
||||||
|
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
string tag;
|
string tag;
|
||||||
TrieNode()
|
TrieNode()
|
||||||
@ -79,6 +80,7 @@ namespace CppJieba
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
TrieNode* _root;
|
TrieNode* _root;
|
||||||
|
vector<TrieNode> _nodeVec;
|
||||||
public:
|
public:
|
||||||
typedef TrieNodeIterator iterator;
|
typedef TrieNodeIterator iterator;
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user