forked from rosette-api/ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsentences.rb
More file actions
18 lines (15 loc) · 701 Bytes
/
sentences.rb
File metadata and controls
18 lines (15 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'rosette_api'
api_key, url = ARGV
if !url
rosette_api = RosetteAPI.new(api_key)
else
rosette_api = RosetteAPI.new(api_key, url)
end
sentences_data = 'This land is your land. This land is my land\nFrom California to the New York island;\nFrom the' \
' wood forest to the Gulf Stream waters\n\nThis land was made for you and Me.\n\nAs I was walking' \
' that ribbon of highway,\nI saw above me that endless skyway:\nI saw below me that' \
' golden valley:\nThis land was made for you and me.'
params = DocumentParameters.new
params.content = sentences_data
response = rosette_api.get_sentences(params)
puts JSON.pretty_generate(response)