sentimental 1.4.1 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +10 -0
- data/Rakefile +5 -0
- data/lib/sentimental.rb +3 -10
- data/sentimental.gemspec +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e7e9cca94e24ee2213210c0183feb9e601d64627f3b1e69b4d82b73790c541b2
|
4
|
+
data.tar.gz: 0bad3d93e03750a65406a0ae404a43437e3cc8c5d62149606947634ca3f32f3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcf014767f06cf1a1f9b410619a1de84ac95488d74e05c402277aecd26def128b5a4584c5e9bca9ebba440540cad355e490c159d03326e2d8256459fe569fd04
|
7
|
+
data.tar.gz: 869a1f31a3d2268df76565ea4c6daf012cf17aebb02b7332067dd28b6f0087dd8b09568816fc1ae7e04fe475306d798ee6c3cbc315c1e03d768a212314557c31
|
data/CHANGELOG.md
ADDED
data/Rakefile
CHANGED
data/lib/sentimental.rb
CHANGED
@@ -91,16 +91,9 @@ class Sentimental
|
|
91
91
|
|
92
92
|
def extract_words_with_n_grams(string)
|
93
93
|
words = extract_words(string)
|
94
|
-
(
|
95
|
-
|
96
|
-
end.flatten
|
97
|
-
end
|
98
|
-
|
99
|
-
def ngramify(words, max_size)
|
100
|
-
return [words.join(' ')] if words.size <= max_size
|
101
|
-
tail = words.last(words.size - 1)
|
102
|
-
|
103
|
-
[words.first(max_size).join(' ')] + ngramify(tail, max_size)
|
94
|
+
1.upto(ngrams).map do |number|
|
95
|
+
words.each_cons(number).to_a
|
96
|
+
end.flatten(1).map { |word| word.join(" ") }
|
104
97
|
end
|
105
98
|
|
106
99
|
def influence_score
|
data/sentimental.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'sentimental'
|
3
|
-
spec.version = '1.
|
3
|
+
spec.version = '1.5.0'
|
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.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Emminger
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2019-05-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -58,22 +58,22 @@ dependencies:
|
|
58
58
|
name: rubocop
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- - "~>"
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: '0.40'
|
64
61
|
- - ">="
|
65
62
|
- !ruby/object:Gem::Version
|
66
63
|
version: 0.40.0
|
64
|
+
- - "~>"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0.40'
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
69
|
version_requirements: !ruby/object:Gem::Requirement
|
70
70
|
requirements:
|
71
|
-
- - "~>"
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
version: '0.40'
|
74
71
|
- - ">="
|
75
72
|
- !ruby/object:Gem::Version
|
76
73
|
version: 0.40.0
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0.40'
|
77
77
|
description: A simple sentiment analysis gem
|
78
78
|
email:
|
79
79
|
- jeff@7compass.com
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- ".gitignore"
|
86
86
|
- ".rspec"
|
87
87
|
- ".rubocop.yml"
|
88
|
+
- CHANGELOG.md
|
88
89
|
- Gemfile
|
89
90
|
- LICENSE.txt
|
90
91
|
- README.md
|
@@ -118,8 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
119
|
- !ruby/object:Gem::Version
|
119
120
|
version: '0'
|
120
121
|
requirements: []
|
121
|
-
|
122
|
-
rubygems_version: 2.5.1
|
122
|
+
rubygems_version: 3.0.1
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Simple sentiment analysis
|