|
75 | 75 | "output_type": "stream", |
76 | 76 | "text": [ |
77 | 77 | "检索数量: 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" |
79 | 79 | ] |
80 | 80 | } |
81 | 81 | ], |
|
156 | 156 | "output_type": "stream", |
157 | 157 | "text": [ |
158 | 158 | "单语检索数量: 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", |
160 | 160 | "-------双语混合检索测试---------\n", |
161 | 161 | "混合检索结果数量: 5\n", |
162 | 162 | "中文检索结果数量: 3\n", |
|
165 | 165 | } |
166 | 166 | ], |
167 | 167 | "source": [ |
168 | | - "result_list = hownet_dict.get(\"苹果\", language=\"ch\")\n", |
| 168 | + "result_list = hownet_dict.get(\"苹果\", language=\"zh\")\n", |
169 | 169 | "print(\"单语检索数量:\",len(result_list))\n", |
170 | 170 | "print(\"单语检索结果范例:\",result_list[0])\n", |
171 | 171 | "print(\"-------双语混合检索测试---------\")\n", |
172 | 172 | "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", |
174 | 174 | "print(\"英语检索结果数量:\",len(hownet_dict.get(\"X\",language=\"en\")))" |
175 | 175 | ] |
176 | 176 | }, |
|
207 | 207 | "metadata": {}, |
208 | 208 | "outputs": [], |
209 | 209 | "source": [ |
210 | | - "ch_word_list = hownet_dict.get_ch_words()\n", |
| 210 | + "zh_word_list = hownet_dict.get_zh_words()\n", |
211 | 211 | "en_word_list = hownet_dict.get_en_words()" |
212 | 212 | ] |
213 | 213 | }, |
|
225 | 225 | } |
226 | 226 | ], |
227 | 227 | "source": [ |
228 | | - "print(ch_word_list[:30])" |
| 228 | + "print(zh_word_list[:30])" |
229 | 229 | ] |
230 | 230 | }, |
231 | 231 | { |
|
282 | 282 | } |
283 | 283 | ], |
284 | 284 | "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)" |
286 | 286 | ] |
287 | 287 | }, |
288 | 288 | { |
|
1466 | 1466 | } |
1467 | 1467 | ], |
1468 | 1468 | "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)" |
1470 | 1470 | ] |
1471 | 1471 | }, |
1472 | 1472 | { |
|
1565 | 1565 | "text/plain": [ |
1566 | 1566 | "{'Def': '{computer|电脑:modifier={PatternValue|样式值:CoEvent={able|能:scope={bring|携带:patient={$}}}}{SpeBrand|特定牌子}}',\n", |
1567 | 1567 | " 'No': '127151',\n", |
1568 | | - " 'ch_grammar': 'noun',\n", |
1569 | | - " 'ch_word': '苹果',\n", |
| 1568 | + " 'zh_grammar': 'noun',\n", |
| 1569 | + " 'zh_word': '苹果',\n", |
1570 | 1570 | " 'en_grammar': 'noun',\n", |
1571 | 1571 | " 'en_word': 'apple',\n", |
1572 | 1572 | " 'syn': [{'id': '004024', 'text': 'IBM'},\n", |
|
1610 | 1610 | "text/plain": [ |
1611 | 1611 | "{'Def': '{computer|电脑:modifier={PatternValue|样式值:CoEvent={able|能:scope={bring|携带:patient={$}}}}{SpeBrand|特定牌子}}',\n", |
1612 | 1612 | " 'No': '127151',\n", |
1613 | | - " 'ch_grammar': 'noun',\n", |
1614 | | - " 'ch_word': '苹果',\n", |
| 1613 | + " 'zh_grammar': 'noun',\n", |
| 1614 | + " 'zh_word': '苹果',\n", |
1615 | 1615 | " 'en_grammar': 'noun',\n", |
1616 | 1616 | " 'en_word': 'apple',\n", |
1617 | 1617 | " 'syn': [{'id': '004024', 'text': 'IBM'},\n", |
|
1707 | 1707 | { |
1708 | 1708 | "data": { |
1709 | 1709 | "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']" |
1711 | 1711 | ] |
1712 | 1712 | }, |
1713 | 1713 | "execution_count": 22, |
|
0 commit comments