@@ -99,7 +99,7 @@ By default, the api will search the target word in both English and Chinese anno
9999>> > print (len (result_list))
1001006
101101>> > print (result_list[0 ])
102- {'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'}
102+ {'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'}
103103
104104>> > hownet_dict.get(" test_for_non_exist_word" )
105105[]
@@ -130,7 +130,7 @@ To boost the efficiency of the search process, you can specify the language of t
130130>> > print (" Number of monolingual results: " ,len (result_list))
131131Number of monolingual results: 6
132132>> > print (" Example of monolingual results: " ,result_list[0 ])
133- Example of monolingual results: {'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'}
133+ Example of monolingual results: {'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'}
134134
135135>> > print (" Number of all the results: " ,len (hownet_dict.get(" X" )))
136136Number of all the results: 5
@@ -146,8 +146,8 @@ Number of English results: 2
146146#### Get All Words Annotated in HowNet
147147
148148``` python
149- >> > ch_word_list = hownet_dict.get_zh_words()
150- >> > print (ch_word_list [:30 ])
149+ >> > zh_word_list = hownet_dict.get_zh_words()
150+ >> > print (zh_word_list [:30 ])
151151[' ' , ' "' , ' #' , ' #号标签' , ' $' , ' %' , " '" , ' (' , ' )' , ' *' , ' +' , ' -' , ' --' , ' ...' , ' ...出什么问题' , ' ...底' , ' ...底下' , ' ...发生故障' , ' ...发生了什么' , ' ...何如' , ' ...家里有几口人' , ' ...检测呈阳性' , ' ...检测呈阴性' , ' ...来' , ' ...内' , ' ...为止' , ' ...也同样使然' , ' ...以来' , ' ...以内' , ' ...以上' ]
152152
153153>> > en_word_list = hownet_dict.get_en_words()
@@ -238,7 +238,7 @@ Two ways to see the corresponding annotation data
238238>> > # two results are the same, only displaying one
239239{' Def' : ' {computer|电脑:modifier={PatternValue|样式值:CoEvent={able|能:scope={bring|携带:patient={$}}}}{SpeBrand|特定牌子}}' ,
240240' en_grammar' : ' noun' ,
241- ' ch_grammar ' : ' noun' ,
241+ ' zh_grammar ' : ' noun' ,
242242' No' : ' 127151' ,
243243' syn' : [
244244 {' id' : ' 004024' , ' text' : ' IBM' },
@@ -262,7 +262,7 @@ Two ways to see the corresponding annotation data
262262 {' id' : ' 172264' , ' text' : ' 膝上型电脑' },
263263 {' id' : ' 172265' , ' text' : ' 膝上型电脑' }
264264],
265- ' ch_word ' : ' 苹果' ,
265+ ' zh_word ' : ' 苹果' ,
266266' en_word' : ' apple' }
267267```
268268
@@ -298,7 +298,7 @@ The similarity metrics are based on sememes.
298298
299299``` python
300300>> > hownet_dict[" 004024" ]
301- [' Def' , ' en_grammar' , ' ch_grammar ' , ' No' , ' syn' , ' ch_word ' , ' en_word' ]
301+ [' Def' , ' en_grammar' , ' zh_grammar ' , ' No' , ' syn' , ' zh_word ' , ' en_word' ]
302302```
303303
304304#### Get all sememes
0 commit comments