sentimental 1.0.1 → 1.0.2

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 (2) hide show
  1. data/lib/sentimental.rb +2 -3
  2. metadata +2 -2
@@ -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
- sentiment_value = @@sentihash[token]
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.1
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-03-29 00:00:00.000000000 Z
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