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
-
#classifier_judge(domain_name, text, options = {}) ⇒ Mushikago::Http::Response
指定されたtextにふさわしいtagを返す.
-
#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 = {}) ⇒ Mushikago::Http::Response
単語の一覧を取得する.
Methods inherited from Mushikago::Http::Client
Constructor Details
This class inherits a constructor from Mushikago::Http::Client
Instance Method Details
#classifier_judge(domain_name, text, options = {}) ⇒ Mushikago::Http::Response
指定された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 |
#collocation_create(domain_name, tags, options = {}) ⇒ Mushikago::Http::Response
共起グラフを作成する
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 |
#collocation_delete(domain_name, collocation_id, options = {}) ⇒ Mushikago::Http::Response
共起グラフを削除する
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 |
#collocation_download(domain_name, collocation_id, options = {}) ⇒ Mushikago::Http::Response
共起グラフをダウンロードする
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 |
#collocation_get(domain_name, collocation_id, word, options = {}) ⇒ Mushikago::Http::Response
共起語を取得する
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 |
#collocation_list(domain_name, options = {}) ⇒ Mushikago::Http::Response
共起グラフ一覧を取得する
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 |
#collocation_wordlist(domain_name, collocation_id, options = {}) ⇒ Mushikago::Http::Response
共起グラフ内の単語一覧を取得する
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 |
#dictionary_delete(dictionary_id, options = {}) ⇒ Mushikago::Http::Response
辞書を削除する
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 |
#dictionary_list(options = {}) ⇒ Mushikago::Http::Response
辞書の一覧を取得する
356 357 358 359 |
# File 'lib/mushikago/hotaru/client.rb', line 356 def dictionary_list ={} request = Hotaru::DictionaryListRequest.new() send_request(request) end |
#dictionary_put(dictionary_file, options = {}) ⇒ Mushikago::Http::Response
辞書を登録する
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 |
#domain_create(domain_name, splitter, options = {}) ⇒ Mushikago::Http::Response
ドメインを作成する
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 |
#domain_delete(domain_name, options = {}) ⇒ Mushikago::Http::Response
ドメインを削除する
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 |
#domain_info(domain_name, options = {}) ⇒ Mushikago::Http::Response
ドメインの情報を参照する
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 |
#domain_list(options = {}) ⇒ Mushikago::Http::Response
ドメインの一覧を取得する
58 59 60 61 |
# File 'lib/mushikago/hotaru/client.rb', line 58 def domain_list ={} request = Hotaru::DomainListRequest.new() send_request(request) end |
#tag_delete(domain_name, tag, options = {}) ⇒ Mushikago::Http::Response
ドメインに登録されているタグを削除する
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 |
#tag_list(domain_name, options = {}) ⇒ Mushikago::Http::Response
ドメイン内のタグ一覧を取得する
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 |
#tag_put(domain_name, tag, options = {}) ⇒ Mushikago::Http::Response
ドメインにタグを登録する
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 |
#text_delete(domain_name, text_id, options = {}) ⇒ Mushikago::Http::Response
テキストを削除する
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 |
#text_get(domain_name, text_id, options = {}) ⇒ Mushikago::Http::Response
テキストを取得する
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 |
#text_list(domain_name, options = {}) ⇒ Mushikago::Http::Response
テキスト一覧を取得する
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 |
#text_put(domain_name, text, tags, options = {}) ⇒ Mushikago::Http::Response
テキストを登録する
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 |
#text_tagset(domain_name, text_id, tags, options = {}) ⇒ Mushikago::Http::Response
テキストにヒモ付たタグの追加更新
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 |
#word_get(domain_name, word, options = {}) ⇒ Mushikago::Http::Response
指定した単語の詳細な情報を返す
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 |
#word_list(domain_name, options = {}) ⇒ Mushikago::Http::Response
単語の一覧を取得する
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 |