Skip to content

Commit 3dcb11d

Browse files
committed
fix bugs and update data file
1 parent 5d9c04d commit 3dcb11d

58 files changed

Lines changed: 7903 additions & 1614122 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
HowNet_dict
2-
HowNet_dict_complete
31
.idea
42
__pycache__
5-
HowNet/pack
63
.ipynb_checkpoints
7-
dict.tar
8-
pack.tar
4+
/build/
5+
/dist/
6+
/MANIFEST.in
7+
/*.py
8+
*.swp
9+
*.egg-info
10+
/OpenHowNet/HowNet_dict*
11+
.DS_Store
12+

DemoForHowNetPackage.ipynb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"output_type": "stream",
7676
"text": [
7777
"检索数量: 6\n",
78-
"检索结果范例: {'Def': '{computer|电脑:modifier={PatternValue|样式值:CoEvent={able|能:scope={bring|携带:patient={$}}}}{SpeBrand|特定牌子}}', 'en_grammar': 'noun', 'ch_grammar': 'noun', 'No': '127151', 'syn': [{'id': '004024', 'text': 'IBM'}, {'id': '041684', 'text': '戴尔'}, {'id': '049006', 'text': '东芝'}, {'id': '106795', 'text': '联想'}, {'id': '156029', 'text': '索尼'}, {'id': '004203', 'text': 'iPad'}, {'id': '019457', 'text': '笔记本'}, {'id': '019458', 'text': '笔记本电脑'}, {'id': '019459', 'text': '笔记本电脑'}, {'id': '019460', 'text': '笔记本电脑'}, {'id': '019461', 'text': '笔记本电脑'}, {'id': '019463', 'text': '笔记簿电脑'}, {'id': '019464', 'text': '笔记簿电脑'}, {'id': '020567', 'text': '便携式电脑'}, {'id': '020568', 'text': '便携式计算机'}, {'id': '020569', 'text': '便携式计算机'}, {'id': '127224', 'text': '平板电脑'}, {'id': '127225', 'text': '平板电脑'}, {'id': '172264', 'text': '膝上型电脑'}, {'id': '172265', 'text': '膝上型电脑'}], 'ch_word': '苹果', 'en_word': 'apple'}\n"
78+
"检索结果范例: {'Def': '{computer|电脑:modifier={PatternValue|样式值:CoEvent={able|能:scope={bring|携带:patient={$}}}}{SpeBrand|特定牌子}}', 'en_grammar': 'noun', 'zh_grammar': 'noun', 'No': '127151', 'syn': [{'id': '004024', 'text': 'IBM'}, {'id': '041684', 'text': '戴尔'}, {'id': '049006', 'text': '东芝'}, {'id': '106795', 'text': '联想'}, {'id': '156029', 'text': '索尼'}, {'id': '004203', 'text': 'iPad'}, {'id': '019457', 'text': '笔记本'}, {'id': '019458', 'text': '笔记本电脑'}, {'id': '019459', 'text': '笔记本电脑'}, {'id': '019460', 'text': '笔记本电脑'}, {'id': '019461', 'text': '笔记本电脑'}, {'id': '019463', 'text': '笔记簿电脑'}, {'id': '019464', 'text': '笔记簿电脑'}, {'id': '020567', 'text': '便携式电脑'}, {'id': '020568', 'text': '便携式计算机'}, {'id': '020569', 'text': '便携式计算机'}, {'id': '127224', 'text': '平板电脑'}, {'id': '127225', 'text': '平板电脑'}, {'id': '172264', 'text': '膝上型电脑'}, {'id': '172265', 'text': '膝上型电脑'}], 'zh_word': '苹果', 'en_word': 'apple'}\n"
7979
]
8080
}
8181
],
@@ -156,7 +156,7 @@
156156
"output_type": "stream",
157157
"text": [
158158
"单语检索数量: 6\n",
159-
"单语检索结果范例: {'Def': '{computer|电脑:modifier={PatternValue|样式值:CoEvent={able|能:scope={bring|携带:patient={$}}}}{SpeBrand|特定牌子}}', 'en_grammar': 'noun', 'ch_grammar': 'noun', 'No': '127151', 'syn': [{'id': '004024', 'text': 'IBM'}, {'id': '041684', 'text': '戴尔'}, {'id': '049006', 'text': '东芝'}, {'id': '106795', 'text': '联想'}, {'id': '156029', 'text': '索尼'}, {'id': '004203', 'text': 'iPad'}, {'id': '019457', 'text': '笔记本'}, {'id': '019458', 'text': '笔记本电脑'}, {'id': '019459', 'text': '笔记本电脑'}, {'id': '019460', 'text': '笔记本电脑'}, {'id': '019461', 'text': '笔记本电脑'}, {'id': '019463', 'text': '笔记簿电脑'}, {'id': '019464', 'text': '笔记簿电脑'}, {'id': '020567', 'text': '便携式电脑'}, {'id': '020568', 'text': '便携式计算机'}, {'id': '020569', 'text': '便携式计算机'}, {'id': '127224', 'text': '平板电脑'}, {'id': '127225', 'text': '平板电脑'}, {'id': '172264', 'text': '膝上型电脑'}, {'id': '172265', 'text': '膝上型电脑'}], 'ch_word': '苹果', 'en_word': 'apple'}\n",
159+
"单语检索结果范例: {'Def': '{computer|电脑:modifier={PatternValue|样式值:CoEvent={able|能:scope={bring|携带:patient={$}}}}{SpeBrand|特定牌子}}', 'en_grammar': 'noun', 'zh_grammar': 'noun', 'No': '127151', 'syn': [{'id': '004024', 'text': 'IBM'}, {'id': '041684', 'text': '戴尔'}, {'id': '049006', 'text': '东芝'}, {'id': '106795', 'text': '联想'}, {'id': '156029', 'text': '索尼'}, {'id': '004203', 'text': 'iPad'}, {'id': '019457', 'text': '笔记本'}, {'id': '019458', 'text': '笔记本电脑'}, {'id': '019459', 'text': '笔记本电脑'}, {'id': '019460', 'text': '笔记本电脑'}, {'id': '019461', 'text': '笔记本电脑'}, {'id': '019463', 'text': '笔记簿电脑'}, {'id': '019464', 'text': '笔记簿电脑'}, {'id': '020567', 'text': '便携式电脑'}, {'id': '020568', 'text': '便携式计算机'}, {'id': '020569', 'text': '便携式计算机'}, {'id': '127224', 'text': '平板电脑'}, {'id': '127225', 'text': '平板电脑'}, {'id': '172264', 'text': '膝上型电脑'}, {'id': '172265', 'text': '膝上型电脑'}], 'zh_word': '苹果', 'en_word': 'apple'}\n",
160160
"-------双语混合检索测试---------\n",
161161
"混合检索结果数量: 5\n",
162162
"中文检索结果数量: 3\n",
@@ -165,12 +165,12 @@
165165
}
166166
],
167167
"source": [
168-
"result_list = hownet_dict.get(\"苹果\", language=\"ch\")\n",
168+
"result_list = hownet_dict.get(\"苹果\", language=\"zh\")\n",
169169
"print(\"单语检索数量:\",len(result_list))\n",
170170
"print(\"单语检索结果范例:\",result_list[0])\n",
171171
"print(\"-------双语混合检索测试---------\")\n",
172172
"print(\"混合检索结果数量:\",len(hownet_dict.get(\"X\")))\n",
173-
"print(\"中文检索结果数量:\",len(hownet_dict.get(\"X\",language=\"ch\")))\n",
173+
"print(\"中文检索结果数量:\",len(hownet_dict.get(\"X\",language=\"zh\")))\n",
174174
"print(\"英语检索结果数量:\",len(hownet_dict.get(\"X\",language=\"en\")))"
175175
]
176176
},
@@ -207,7 +207,7 @@
207207
"metadata": {},
208208
"outputs": [],
209209
"source": [
210-
"ch_word_list = hownet_dict.get_ch_words()\n",
210+
"zh_word_list = hownet_dict.get_zh_words()\n",
211211
"en_word_list = hownet_dict.get_en_words()"
212212
]
213213
},
@@ -225,7 +225,7 @@
225225
}
226226
],
227227
"source": [
228-
"print(ch_word_list[:30])"
228+
"print(zh_word_list[:30])"
229229
]
230230
},
231231
{
@@ -282,7 +282,7 @@
282282
}
283283
],
284284
"source": [
285-
"hownet_dict.get_sememes_by_word(\"苹果\",structured=False,lang=\"ch\",merge=True)"
285+
"hownet_dict.get_sememes_by_word(\"苹果\",structured=False,lang=\"zh\",merge=True)"
286286
]
287287
},
288288
{
@@ -1466,7 +1466,7 @@
14661466
}
14671467
],
14681468
"source": [
1469-
"hownet_dict.get_sememes_by_word(\"苹果\",structured=False,lang=\"ch\",merge=False)"
1469+
"hownet_dict.get_sememes_by_word(\"苹果\",structured=False,lang=\"zh\",merge=False)"
14701470
]
14711471
},
14721472
{
@@ -1565,8 +1565,8 @@
15651565
"text/plain": [
15661566
"{'Def': '{computer|电脑:modifier={PatternValue|样式值:CoEvent={able|能:scope={bring|携带:patient={$}}}}{SpeBrand|特定牌子}}',\n",
15671567
" 'No': '127151',\n",
1568-
" 'ch_grammar': 'noun',\n",
1569-
" 'ch_word': '苹果',\n",
1568+
" 'zh_grammar': 'noun',\n",
1569+
" 'zh_word': '苹果',\n",
15701570
" 'en_grammar': 'noun',\n",
15711571
" 'en_word': 'apple',\n",
15721572
" 'syn': [{'id': '004024', 'text': 'IBM'},\n",
@@ -1610,8 +1610,8 @@
16101610
"text/plain": [
16111611
"{'Def': '{computer|电脑:modifier={PatternValue|样式值:CoEvent={able|能:scope={bring|携带:patient={$}}}}{SpeBrand|特定牌子}}',\n",
16121612
" 'No': '127151',\n",
1613-
" 'ch_grammar': 'noun',\n",
1614-
" 'ch_word': '苹果',\n",
1613+
" 'zh_grammar': 'noun',\n",
1614+
" 'zh_word': '苹果',\n",
16151615
" 'en_grammar': 'noun',\n",
16161616
" 'en_word': 'apple',\n",
16171617
" 'syn': [{'id': '004024', 'text': 'IBM'},\n",
@@ -1707,7 +1707,7 @@
17071707
{
17081708
"data": {
17091709
"text/plain": [
1710-
"['Def', 'en_grammar', 'ch_grammar', 'No', 'syn', 'ch_word', 'en_word']"
1710+
"['Def', 'en_grammar', 'zh_grammar', 'No', 'syn', 'zh_word', 'en_word']"
17111711
]
17121712
},
17131713
"execution_count": 22,

0 commit comments

Comments
 (0)