sentimental 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sentimental.rb +2 -3
- metadata +2 -2
data/lib/sentimental.rb
CHANGED
@@ -44,7 +44,7 @@
|
|
44
44
|
# => :neutral
|
45
45
|
#
|
46
46
|
class Sentimental
|
47
|
-
@@sentihash =
|
47
|
+
@@sentihash = Hash.new(0.0)
|
48
48
|
@@threshold = 0.0
|
49
49
|
|
50
50
|
def initialize(threshold = nil)
|
@@ -65,8 +65,7 @@ class Sentimental
|
|
65
65
|
tokens = string.to_s.downcase.split(/[\s\!\?\.]+/)
|
66
66
|
|
67
67
|
tokens.each do |token|
|
68
|
-
|
69
|
-
sentiment_total += sentiment_value if sentiment_value
|
68
|
+
sentiment_total += @@sentihash[token]
|
70
69
|
end
|
71
70
|
sentiment_total
|
72
71
|
end
|
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.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-04-21 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: A simple sentiment analysis gem
|
16
16
|
email: jeff@7compass.com
|