Created
May 30, 2014 12:43
-
-
Save kaiinui/b760fc72c7d053b17280 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yahoo_parse_api' | |
class YahooMA | |
def self.parse(sentence) | |
client.parse(sentence, param) | |
end | |
def self.nouns(sentence) | |
parse(sentence)["ResultSet"]["ma_result"]["word_list"]["word"].map {|a| a["surface"]} | |
end | |
def self.param | |
{ | |
results: 'ma', | |
filter: '7|9' | |
} | |
end | |
def self.client | |
@client ||= YahooParseApi::Parse.new | |
end | |
end |
[5] pry(main)> YahooMA.nouns("AirPortの無線ネットワークはどうやって設定しますか ")
["AirPort", "無線", "ネットワーク", "設定"]
Really smart
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
++