diff --git a/examples/categories.rb b/examples/categories.rb index 704a941..132bd4e 100644 --- a/examples/categories.rb +++ b/examples/categories.rb @@ -8,6 +8,7 @@ rosette_api = RosetteAPI.new(api_key, url) end -params = DocumentParameters.new(content_uri: 'http://www.onlocationvacations.com/2015/03/05/the-new-ghostbusters-movie-begins-filming-in-boston-in-june/') +categories_url_data = 'http://www.onlocationvacations.com/2015/03/05/the-new-ghostbusters-movie-begins-filming-in-boston-in-june/' +params = DocumentParameters.new(content_uri: categories_url_data) response = rosette_api.get_categories(params) puts JSON.pretty_generate(response) diff --git a/examples/entities.rb b/examples/entities.rb index 2d68ae2..ed7625b 100644 --- a/examples/entities.rb +++ b/examples/entities.rb @@ -8,6 +8,7 @@ rosette_api = RosetteAPI.new(api_key, url) end -params = DocumentParameters.new(content: 'Bill Murray will appear in new Ghostbusters film: Dr. Peter Venkman was spotted filming a cameo in Boston this… http://dlvr.it/BnsFfS') +entities_text_data = 'Bill Murray will appear in new Ghostbusters film: Dr. Peter Venkman was spotted filming a cameo in Boston this… http://dlvr.it/BnsFfS' +params = DocumentParameters.new(content: entities_text_data) response = rosette_api.get_entities(params) puts JSON.pretty_generate(response) diff --git a/examples/entities_linked.rb b/examples/entities_linked.rb index 7b32737..cb96868 100644 --- a/examples/entities_linked.rb +++ b/examples/entities_linked.rb @@ -8,6 +8,7 @@ rosette_api = RosetteAPI.new(api_key, url) end -params = DocumentParameters.new(content: 'Last month director Paul Feig announced the movie will have an all-star female cast including Kristen Wiig, Melissa McCarthy, Leslie Jones and Kate McKinnon.', genre: 'social-media') +entities_linked_text_data = 'Last month director Paul Feig announced the movie will have an all-star female cast including Kristen Wiig, Melissa McCarthy, Leslie Jones and Kate McKinnon.' +params = DocumentParameters.new(content: entities_linked_text_data, genre: 'social-media') response = rosette_api.get_entities(params, true) puts JSON.pretty_generate(response) \ No newline at end of file diff --git a/examples/language.rb b/examples/language.rb index 29612ab..8175b2a 100644 --- a/examples/language.rb +++ b/examples/language.rb @@ -8,6 +8,7 @@ rosette_api = RosetteAPI.new(api_key, url) end -params = DocumentParameters.new(content: 'Por favor Señorita, says the man.?') +language_data = 'Por favor Señorita, says the man.?' +params = DocumentParameters.new(content: language_data) response = rosette_api.get_language(params) puts JSON.pretty_generate(response) \ No newline at end of file diff --git a/examples/morphology_complete.rb b/examples/morphology_complete.rb index 3803e60..0842fbd 100644 --- a/examples/morphology_complete.rb +++ b/examples/morphology_complete.rb @@ -8,6 +8,7 @@ rosette_api = RosetteAPI.new(api_key, url) end -params = DocumentParameters.new(content: 'The quick brown fox jumped over the lazy dog. Yes he did.') +morphology_complete_data = 'The quick brown fox jumped over the lazy dog. Yes he did.' +params = DocumentParameters.new(content: morphology_complete_data) response = rosette_api.get_morphology_complete(params) puts JSON.pretty_generate(response) diff --git a/examples/morphology_compound-components.rb b/examples/morphology_compound-components.rb index 622298f..75d1ff0 100644 --- a/examples/morphology_compound-components.rb +++ b/examples/morphology_compound-components.rb @@ -8,6 +8,7 @@ rosette_api = RosetteAPI.new(api_key, url) end -params = DocumentParameters.new(content: 'Rechtsschutzversicherungsgesellschaften') +morphology_compound_components_data = 'Rechtsschutzversicherungsgesellschaften' +params = DocumentParameters.new(content: morphology_compound_components_data) response = rosette_api.get_compound_components(params) puts JSON.pretty_generate(response) \ No newline at end of file diff --git a/examples/morphology_han-readings.rb b/examples/morphology_han-readings.rb index 226535c..b3d0685 100644 --- a/examples/morphology_han-readings.rb +++ b/examples/morphology_han-readings.rb @@ -8,6 +8,7 @@ rosette_api = RosetteAPI.new(api_key, url) end -params = DocumentParameters.new(content: '北京大学生物系主任办公室内部会议') +morphology_han_readings_data = '北京大学生物系主任办公室内部会议' +params = DocumentParameters.new(content: morphology_han_readings_data) response = rosette_api.get_han_readings(params) puts JSON.pretty_generate(response) \ No newline at end of file diff --git a/examples/morphology_lemmas.rb b/examples/morphology_lemmas.rb index 51404ce..ce72907 100644 --- a/examples/morphology_lemmas.rb +++ b/examples/morphology_lemmas.rb @@ -8,6 +8,7 @@ rosette_api = RosetteAPI.new(api_key, url) end -params = DocumentParameters.new(content: "The fact is that the geese just went back to get a rest and I'm not banking on their return soon") +morphology_lemmas_data = "The fact is that the geese just went back to get a rest and I'm not banking on their return soon" +params = DocumentParameters.new(content: morphology_lemmas_data) response = rosette_api.get_lemmas(params) puts JSON.pretty_generate(response) \ No newline at end of file diff --git a/examples/morphology_parts-of-speech.rb b/examples/morphology_parts-of-speech.rb index 464c29b..ea65436 100644 --- a/examples/morphology_parts-of-speech.rb +++ b/examples/morphology_parts-of-speech.rb @@ -8,6 +8,7 @@ rosette_api = RosetteAPI.new(api_key, url) end -params = DocumentParameters.new(content: "The fact is that the geese just went back to get a rest and I'm not banking on their return soon") +morphology_parts_of_speech_data = "The fact is that the geese just went back to get a rest and I'm not banking on their return soon" +params = DocumentParameters.new(content: morphology_parts_of_speech_data) response = rosette_api.get_parts_of_speech(params) puts JSON.pretty_generate(response) \ No newline at end of file diff --git a/examples/name_similarity.rb b/examples/name_similarity.rb index 2197a03..b8155e0 100644 --- a/examples/name_similarity.rb +++ b/examples/name_similarity.rb @@ -8,8 +8,9 @@ rosette_api = RosetteAPI.new(api_key, url) end - -name1 = NameParameter.new('Michael Jackson', entity_type: 'PERSON', language:'eng') -params = NameSimilarityParameters.new(name1, '迈克尔·杰克逊') +matched_name_data1 = 'Michael Jackson' +matched_name_data2 = '迈克尔·杰克逊' +name1 = NameParameter.new(matched_name_data1, entity_type: 'PERSON', language:'eng') +params = NameSimilarityParameters.new(name1, matched_name_data2) response = rosette_api.name_similarity(params) puts JSON.pretty_generate(response) \ No newline at end of file diff --git a/examples/name_translation.rb b/examples/name_translation.rb index b88922f..efc24e3 100644 --- a/examples/name_translation.rb +++ b/examples/name_translation.rb @@ -8,6 +8,7 @@ rosette_api = RosetteAPI.new(api_key, url) end -params = NameTranslationParameters.new('معمر محمد أبو منيار القذاف', 'eng', target_script: 'Latn') +translated_name_data = 'معمر محمد أبو منيار القذاف' +params = NameTranslationParameters.new(translated_name_data, 'eng', target_script: 'Latn') response = rosette_api.name_translation(params) puts JSON.pretty_generate(response) \ No newline at end of file diff --git a/examples/relationships.rb b/examples/relationships.rb index 59bf35f..63e98b2 100644 --- a/examples/relationships.rb +++ b/examples/relationships.rb @@ -8,6 +8,7 @@ rosette_api = RosetteAPI.new(api_key, url) end -params = DocumentParameters.new(content: 'The Ghostbusters movie was filmed in Boston.') +relationships_text_data = 'The Ghostbusters movie was filmed in Boston.' +params = DocumentParameters.new(content: relationships_text_data) response = rosette_api.get_relationships(params) puts JSON.pretty_generate(response) \ No newline at end of file diff --git a/examples/sentences.rb b/examples/sentences.rb index 4a5245b..a840bbd 100644 --- a/examples/sentences.rb +++ b/examples/sentences.rb @@ -8,10 +8,11 @@ rosette_api = RosetteAPI.new(api_key, url) end -params = DocumentParameters.new -params.content = 'This land is your land. This land is my land\nFrom California to the New York island;\nFrom the' \ +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) \ No newline at end of file diff --git a/examples/sentiment.rb b/examples/sentiment.rb index 6155ea2..8ddb2fd 100644 --- a/examples/sentiment.rb +++ b/examples/sentiment.rb @@ -11,12 +11,12 @@ file = Tempfile.new(%w(foo .html)) -sentiment_text_data = 'New Ghostbusters Film

Original Ghostbuster Dan ' \ +sentiment_file_data = 'New Ghostbusters Film

Original Ghostbuster Dan ' \ 'Aykroyd, who also co-wrote the 1984 Ghostbusters film, couldn’t be more pleased with the new ' \ 'all-female Ghostbusters cast, telling The Hollywood Reporter, The Aykroyd family is delighted ' \ 'by this inheritance of the Ghostbusters torch by these most magnificent women in comedy ' \ '.

' -file.write(sentiment_text_data) +file.write(sentiment_file_data) file.close params = DocumentParameters.new(file_path: file.path, language: 'eng') response = rosette_api.get_sentiment(params) diff --git a/examples/tokens.rb b/examples/tokens.rb index 8be177e..e35194e 100644 --- a/examples/tokens.rb +++ b/examples/tokens.rb @@ -8,6 +8,7 @@ rosette_api = RosetteAPI.new(api_key, url) end -params = DocumentParameters.new(content: '北京大学生物系主任办公室内部会议') +tokens_data = '北京大学生物系主任办公室内部会议' +params = DocumentParameters.new(content: tokens_data) response = rosette_api.get_tokens(params) puts JSON.pretty_generate(response) \ No newline at end of file