sentimental 1.1.0 → 1.1.1

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.
Files changed (4) hide show
  1. checksums.yaml +5 -13
  2. data/README.md +19 -17
  3. data/sentimental.gemspec +1 -1
  4. metadata +12 -12
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NTM5MTBkMzdiNWY0NzdiYzliOWJlZWNmZDIyMzVjMDM1ZWJjNDYxYw==
5
- data.tar.gz: !binary |-
6
- NTVlYWNhNDIxZmE3ZDUyZjQ4N2ZlMGYxYWY0NzYxYmIxYWY2ZDZjNg==
2
+ SHA1:
3
+ metadata.gz: 63ca1cc3a2e131c766fda7b6ffef711958b77af4
4
+ data.tar.gz: da25b0c71603372b554e3624e4113d667155d6dc
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YjM0OTc1MzYyMDdlMmYyMWIyOTgwNmYyYThiMDhjZjkzMDFkYmFiNGNjYjBl
10
- OWY3Zjg1NmFkZTgxY2YzY2I2OGMxZjBhNzhlZjEwNjkzNDQxNTRhNTQxYzFj
11
- Yjc2NDBmZjk0OWZkYTc3ODMyMjFjN2RlY2FjMDFlNWMzMjRhM2M=
12
- data.tar.gz: !binary |-
13
- Nzg5YzMwMjM3MjU3YzJhOTU4NGIzN2NkZTY4ZjhkMGVmOWY5ZjcyNmMxYzdm
14
- YzlkOGM5MDNhMzBiMjhkMmIyZThiMzAxYzA3Y2UxYTc2N2JlYmMzODE3MDFk
15
- MDhhZjkwYTNmMGU1NDE1MTY0ZDUzNGZkYmRmM2JkMzVjM2M3Y2Y=
6
+ metadata.gz: 33f62d43418c9d02206ec0897572a9efb47ae5dac4189c8fa6c07e889608f23c92fa3478990611d2b697d630fba4652dba5d501483f547a6d278ebfde5930ee6
7
+ data.tar.gz: 3c45a95fafdcf12949dd67ea1c0b075d0628951f07168de5c803935db456d07ba4cbc478acf5715fcd830b67808c04dcceaf97f130f7cc99277afd2b83251aaf
data/README.md CHANGED
@@ -5,12 +5,12 @@ Simple sentiment analysis with Ruby
5
5
  ## How it works
6
6
 
7
7
  Sentences are tokenized, tokens are assigned a numerical score
8
- for their average sentiment. The total score is then used to
8
+ for their average sentiment. The total score is then used to
9
9
  determine the overall sentiment in relation to the thresold.
10
10
 
11
11
  For example, the default threshold is 0.0. If a sentence has
12
12
  a score of 0, it is deemed "neutral". Higher than the thresold
13
- is "positive", lower is "negative".
13
+ is "positive", lower is "negative".
14
14
 
15
15
  If you set the threshold to a non-zero amount, e.g. 0.25:
16
16
 
@@ -23,39 +23,41 @@ If you set the threshold to a non-zero amount, e.g. 0.25:
23
23
 
24
24
  ```ruby
25
25
 
26
+ # Create an instance for usage
27
+ analyzer = Sentimental.new
28
+
26
29
  # Load the default sentiment dictionaries
27
- Sentimental.load_defaults
30
+ analyzer.load_defaults
28
31
 
29
32
  # And/or load your own dictionaries
30
- Sentimental.load_senti_file('path/to/your/file.txt')
33
+ analyzer.load_senti_file('path/to/your/file.txt')
31
34
 
32
35
  # Set a global threshold
33
- Sentimental.threshold = 0.1
36
+ analyzer.threshold = 0.1
34
37
 
35
- # Create an instance for usage:
36
- analyzer = Sentimental.new
37
- analyzer.get_sentiment 'I love ruby'
38
+ # Use your analyzer
39
+ analyzer.sentiment 'I love ruby'
38
40
  #=> :positive
39
41
 
40
- analyzer.get_sentiment 'I like ruby'
42
+ analyzer.sentiment 'I like ruby'
41
43
  #=> :neutral
42
44
 
43
- analyzer.get_sentiment 'I really like ruby'
45
+ analyzer.sentiment 'I really like ruby'
44
46
  #=> :positive
45
47
 
46
48
  # You can make new analyzers with individual thresholds:
47
- analyzer = Sentimental.new(0.9)
48
- analyzer.get_sentiment 'I love ruby'
49
+ analyzer = Sentimental.new(threshold: 0.9)
50
+ analyzer.sentiment 'I love ruby'
49
51
  #=> :positive
50
52
 
51
- analyzer.get_sentiment 'I like ruby'
53
+ analyzer.sentiment 'I like ruby'
52
54
  #=> :neutral
53
-
54
- analyzer.get_sentiment 'I really like ruby'
55
+
56
+ analyzer.sentiment 'I really like ruby'
55
57
  #=> :neutral
56
58
 
57
59
  # Get the numerical score of a string:
58
- analyzer.get_score 'I love ruby'
60
+ analyzer.score 'I love ruby'
59
61
  #=> 0.925
60
62
 
61
63
  ```
@@ -69,7 +71,7 @@ scores and tokens, e.g.:
69
71
  0.0 Meh
70
72
  -1.0 Horrible
71
73
 
72
- ## Installation
74
+ ## Installation
73
75
 
74
76
  gem install sentimental
75
77
 
data/sentimental.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'sentimental'
3
- spec.version = '1.1.0'
3
+ spec.version = '1.1.1'
4
4
  spec.summary = 'Simple sentiment analysis'
5
5
  spec.description = 'A simple sentiment analysis gem'
6
6
  spec.authors = ['Jeff Emminger', 'Christopher MacLellan', 'Denis Pasin']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentimental
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Emminger
@@ -10,48 +10,48 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-03-10 00:00:00.000000000 Z
13
+ date: 2016-03-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ~>
19
+ - - "~>"
20
20
  - !ruby/object:Gem::Version
21
21
  version: '1.3'
22
22
  type: :development
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ~>
26
+ - - "~>"
27
27
  - !ruby/object:Gem::Version
28
28
  version: '1.3'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: rake
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ! '>='
33
+ - - ">="
34
34
  - !ruby/object:Gem::Version
35
35
  version: '0'
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ! '>='
40
+ - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: '0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rspec
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ! '>='
47
+ - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: 3.0.0
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ! '>='
54
+ - - ">="
55
55
  - !ruby/object:Gem::Version
56
56
  version: 3.0.0
57
57
  description: A simple sentiment analysis gem
@@ -62,7 +62,7 @@ executables: []
62
62
  extensions: []
63
63
  extra_rdoc_files: []
64
64
  files:
65
- - .gitignore
65
+ - ".gitignore"
66
66
  - Gemfile
67
67
  - Gemfile.lock
68
68
  - LICENSE.txt
@@ -83,17 +83,17 @@ require_paths:
83
83
  - lib
84
84
  required_ruby_version: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ! '>='
86
+ - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - ! '>='
91
+ - - ">="
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  requirements: []
95
95
  rubyforge_project:
96
- rubygems_version: 2.4.8
96
+ rubygems_version: 2.4.6
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: Simple sentiment analysis