watson-tone-analyzer 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/watson-tone-analyzer.rb +16 -0
- metadata +64 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d25b391441b7a2a247e6981e31ae69c78eb3a5fa
|
4
|
+
data.tar.gz: 79aac17f60c8c11b26ee6c41475295a6b5befb20
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c56da4cc932bab01eff911795c0b255444678d3401ef76791f46b5717b0cf9466b7128b2a4238becb93597df6fbfc34019a17907f5f8c4c80bc7438d813bff19
|
7
|
+
data.tar.gz: 60e5db921477735169217f4ff860dd48f62a5301accf46ade883e350ca769e8d4d8fdde77cfd4fb03231f442e4566d14fdbad44c309f5ac7663f504967ef53b0
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'http'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
class ToneAnalyzer
|
5
|
+
def initialize(username, password)
|
6
|
+
@password = password
|
7
|
+
@username = username
|
8
|
+
@url = "https://gateway.watsonplatform.net/tone-analyzer/api/v3/tone?version=2016-05-19"
|
9
|
+
end
|
10
|
+
|
11
|
+
def analyze(text)
|
12
|
+
response = HTTP.basic_auth(:user => @username, :pass => @password)
|
13
|
+
.post(@url, :json => { "text": text})
|
14
|
+
return JSON.parse(response)
|
15
|
+
end
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: watson-tone-analyzer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Maggie Moss
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-08-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: http
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2.0'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2'
|
33
|
+
description: Analyzes emotions, social tendencies and writing style of text
|
34
|
+
email:
|
35
|
+
executables: []
|
36
|
+
extensions: []
|
37
|
+
extra_rdoc_files: []
|
38
|
+
files:
|
39
|
+
- lib/watson-tone-analyzer.rb
|
40
|
+
homepage:
|
41
|
+
licenses:
|
42
|
+
- MIT
|
43
|
+
metadata: {}
|
44
|
+
post_install_message:
|
45
|
+
rdoc_options: []
|
46
|
+
require_paths:
|
47
|
+
- lib
|
48
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
requirements: []
|
59
|
+
rubyforge_project:
|
60
|
+
rubygems_version: 2.4.5.1
|
61
|
+
signing_key:
|
62
|
+
specification_version: 4
|
63
|
+
summary: Helps send requests to the watson API to analyze tone of text
|
64
|
+
test_files: []
|