Class: Mushikago::Hotaru::Client
- Inherits:
-
Mushikago::Http::Client
- Object
- Mushikago::Http::Client
- Mushikago::Hotaru::Client
- Defined in:
- lib/mushikago/hotaru/client.rb
Overview
Hotaruサービスを利用する
Instance Attribute Summary
Attributes inherited from Mushikago::Http::Client
Instance Method Summary (collapse)
-
- (Mushikago::Http::Response) classifier_judge(domain_name, text, options = {})
指定されたtextにふさわしいtagを返す.
-
- (Mushikago::Http::Response) collocation_create(domain_name, tags, options = {})
共起グラフを作成する.
-
- (Mushikago::Http::Response) collocation_delete(domain_name, collocation_id, options = {})
共起グラフを削除する.
-
- (Mushikago::Http::Response) collocation_download(domain_name, collocation_id, options = {})
共起グラフをダウンロードする.
-
- (Mushikago::Http::Response) collocation_get(domain_name, collocation_id, word, options = {})
共起語を取得する.
-
- (Mushikago::Http::Response) collocation_list(domain_name, options = {})
共起グラフ一覧を取得する.
-
- (Mushikago::Http::Response) collocation_wordlist(domain_name, collocation_id, options = {})
共起グラフ内の単語一覧を取得する.
-
- (Mushikago::Http::Response) dictionary_delete(dictionary_id, options = {})
辞書を削除する.
-
- (Mushikago::Http::Response) dictionary_list(options = {})
辞書の一覧を取得する.
-
- (Mushikago::Http::Response) dictionary_put(dictionary_file, options = {})
辞書を登録する.
-
- (Mushikago::Http::Response) domain_create(domain_name, splitter, options = {})
ドメインを作成する.
-
- (Mushikago::Http::Response) domain_delete(domain_name, options = {})
ドメインを削除する.
-
- (Mushikago::Http::Response) domain_info(domain_name, options = {})
ドメインの情報を参照する.
-
- (Mushikago::Http::Response) domain_list(options = {})
ドメインの一覧を取得する.
-
- (Mushikago::Http::Response) tag_delete(domain_name, tag, options = {})
ドメインに登録されているタグを削除する.
-
- (Mushikago::Http::Response) tag_list(domain_name, options = {})
ドメイン内のタグ一覧を取得する.
-
- (Mushikago::Http::Response) tag_put(domain_name, tag, options = {})
ドメインにタグを登録する.
-
- (Mushikago::Http::Response) text_delete(domain_name, text_id, options = {})
テキストを削除する.
-
- (Mushikago::Http::Response) text_get(domain_name, text_id, options = {})
テキストを取得する.
-
- (Mushikago::Http::Response) text_list(domain_name, options = {})
テキスト一覧を取得する.
-
- (Mushikago::Http::Response) text_put(domain_name, text, tags, options = {})
テキストを登録する.
-
- (Mushikago::Http::Response) text_tagset(domain_name, text_id, tags, options = {})
テキストにヒモ付たタグの追加更新.
-
- (Mushikago::Http::Response) word_get(domain_name, word, options = {})
指定した単語の詳細な情報を返す.
-
- (Mushikago::Http::Response) word_list(domain_name, options = {})
単語の一覧を取得する.
Methods inherited from Mushikago::Http::Client
Constructor Details
This class inherits a constructor from Mushikago::Http::Client
Instance Method Details
- (Mushikago::Http::Response) classifier_judge(domain_name, text, options = {})
指定されたtextにふさわしいtagを返す
166 167 168 169 |
# File 'lib/mushikago/hotaru/client.rb', line 166 def classifier_judge domain_name, text, ={} request = Hotaru::ClassifierJudgeRequest.new(domain_name, text, ) send_request(request) end |
- (Mushikago::Http::Response) collocation_create(domain_name, tags, options = {})
共起グラフを作成する
185 186 187 188 |
# File 'lib/mushikago/hotaru/client.rb', line 185 def collocation_create domain_name, , ={} request = Hotaru::CollocationCreateRequest.new(domain_name, , ) send_request(request) end |
- (Mushikago::Http::Response) collocation_delete(domain_name, collocation_id, options = {})
共起グラフを削除する
214 215 216 217 |
# File 'lib/mushikago/hotaru/client.rb', line 214 def collocation_delete domain_name, collocation_id, ={} request = Hotaru::CollocationDeleteRequest.new(domain_name, collocation_id, ) send_request(request) end |
- (Mushikago::Http::Response) collocation_download(domain_name, collocation_id, options = {})
共起グラフをダウンロードする
258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/mushikago/hotaru/client.rb', line 258 def collocation_download domain_name, collocation_id, ={} request = Hotaru::CollocationDownloadRequest.new(domain_name, collocation_id, ) result = send_request(request) if [:with_body] begin uri = URI.parse(result['url']) result['body'] = Net::HTTP.get(uri.host, uri.request_uri) rescue end end return result end |
- (Mushikago::Http::Response) collocation_get(domain_name, collocation_id, word, options = {})
共起語を取得する
228 229 230 231 |
# File 'lib/mushikago/hotaru/client.rb', line 228 def collocation_get domain_name, collocation_id, word, ={} request = Hotaru::CollocationGetRequest.new(domain_name, collocation_id, word, ) send_request(request) end |
- (Mushikago::Http::Response) collocation_list(domain_name, options = {})
共起グラフ一覧を取得する
201 202 203 204 |
# File 'lib/mushikago/hotaru/client.rb', line 201 def collocation_list domain_name, ={} request = Hotaru::CollocationListRequest.new(domain_name, ) send_request(request) end |
- (Mushikago::Http::Response) collocation_wordlist(domain_name, collocation_id, options = {})
共起グラフ内の単語一覧を取得する
244 245 246 247 |
# File 'lib/mushikago/hotaru/client.rb', line 244 def collocation_wordlist domain_name, collocation_id, ={} request = Hotaru::CollocationWordlistRequest.new(domain_name, collocation_id, ) send_request(request) end |
- (Mushikago::Http::Response) dictionary_delete(dictionary_id, options = {})
辞書を削除する
368 369 370 371 |
# File 'lib/mushikago/hotaru/client.rb', line 368 def dictionary_delete dictionary_id, ={} request = Hotaru::DictionaryDeleteRequest.new(dictionary_id, ) send_request(request) end |
- (Mushikago::Http::Response) dictionary_list(options = {})
辞書の一覧を取得する
356 357 358 359 |
# File 'lib/mushikago/hotaru/client.rb', line 356 def dictionary_list ={} request = Hotaru::DictionaryListRequest.new() send_request(request) end |
- (Mushikago::Http::Response) dictionary_put(dictionary_file, options = {})
辞書を登録する
345 346 347 348 |
# File 'lib/mushikago/hotaru/client.rb', line 345 def dictionary_put dictionary_file, ={} request = Hotaru::DictionaryPutRequest.new(dictionary_file, ) send_request(request) end |
- (Mushikago::Http::Response) domain_create(domain_name, splitter, options = {})
ドメインを作成する
31 32 33 34 |
# File 'lib/mushikago/hotaru/client.rb', line 31 def domain_create domain_name, splitter, ={} request = Hotaru::DomainCreateRequest.new(domain_name, splitter, ) send_request(request) end |
- (Mushikago::Http::Response) domain_delete(domain_name, options = {})
ドメインを削除する
70 71 72 73 |
# File 'lib/mushikago/hotaru/client.rb', line 70 def domain_delete domain_name, ={} request = Hotaru::DomainDeleteRequest.new(domain_name, ) send_request(request) end |
- (Mushikago::Http::Response) domain_info(domain_name, options = {})
ドメインの情報を参照する
44 45 46 47 |
# File 'lib/mushikago/hotaru/client.rb', line 44 def domain_info domain_name, ={} request = Hotaru::DomainInfoRequest.new(domain_name, ) send_request(request) end |
- (Mushikago::Http::Response) domain_list(options = {})
ドメインの一覧を取得する
58 59 60 61 |
# File 'lib/mushikago/hotaru/client.rb', line 58 def domain_list ={} request = Hotaru::DomainListRequest.new() send_request(request) end |
- (Mushikago::Http::Response) tag_delete(domain_name, tag, options = {})
ドメインに登録されているタグを削除する
292 293 294 295 |
# File 'lib/mushikago/hotaru/client.rb', line 292 def tag_delete domain_name, tag, ={} request = Hotaru::TagDeleteRequest.new(domain_name, tag, ) send_request(request) end |
- (Mushikago::Http::Response) tag_list(domain_name, options = {})
ドメイン内のタグ一覧を取得する
305 306 307 308 |
# File 'lib/mushikago/hotaru/client.rb', line 305 def tag_list domain_name, ={} request = Hotaru::TagListRequest.new(domain_name, ) send_request(request) end |
- (Mushikago::Http::Response) tag_put(domain_name, tag, options = {})
ドメインにタグを登録する
279 280 281 282 |
# File 'lib/mushikago/hotaru/client.rb', line 279 def tag_put domain_name, tag, ={} request = Hotaru::TagPutRequest.new(domain_name, tag, ) send_request(request) end |
- (Mushikago::Http::Response) text_delete(domain_name, text_id, options = {})
テキストを削除する
99 100 101 102 |
# File 'lib/mushikago/hotaru/client.rb', line 99 def text_delete domain_name, text_id, ={} request = Hotaru::TextDeleteRequest.new(domain_name, text_id, ) send_request(request) end |
- (Mushikago::Http::Response) text_get(domain_name, text_id, options = {})
テキストを取得する
128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/mushikago/hotaru/client.rb', line 128 def text_get domain_name, text_id, ={} request = Hotaru::TextGetRequest.new(domain_name, text_id, ) result = send_request(request) if [:with_body] begin uri = URI.parse(result['url']) result['body'] = Net::HTTP.get(uri.host, uri.request_uri) rescue end end return result end |
- (Mushikago::Http::Response) text_list(domain_name, options = {})
テキスト一覧を取得する
153 154 155 156 |
# File 'lib/mushikago/hotaru/client.rb', line 153 def text_list domain_name, ={} request = Hotaru::TextListRequest.new(domain_name, ) send_request(request) end |
- (Mushikago::Http::Response) text_put(domain_name, text, tags, options = {})
テキストを登録する
85 86 87 88 |
# File 'lib/mushikago/hotaru/client.rb', line 85 def text_put domain_name, text, , ={} request = Hotaru::TextPutRequest.new(domain_name, text, , ) send_request(request) end |
- (Mushikago::Http::Response) text_tagset(domain_name, text_id, tags, options = {})
テキストにヒモ付たタグの追加更新
114 115 116 117 |
# File 'lib/mushikago/hotaru/client.rb', line 114 def domain_name, text_id, , ={} request = Hotaru::TextTagsetRequest.new(domain_name, text_id, , ) send_request(request) end |
- (Mushikago::Http::Response) word_get(domain_name, word, options = {})
指定した単語の詳細な情報を返す
333 334 335 336 |
# File 'lib/mushikago/hotaru/client.rb', line 333 def word_get domain_name, word, ={} request = Hotaru::WordGetRequest.new(domain_name, word, ) send_request(request) end |
- (Mushikago::Http::Response) word_list(domain_name, options = {})
単語の一覧を取得する
320 321 322 323 |
# File 'lib/mushikago/hotaru/client.rb', line 320 def word_list domain_name, ={} request = Hotaru::WordListRequest.new(domain_name, ) send_request(request) end |