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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: aa7dae46c18fc0a096ff67aaf912813b45720ad8
4
- data.tar.gz: 85af49d6b6e8c63ea700e23bbacaa32d17f13131
2
+ SHA256:
3
+ metadata.gz: e7e9cca94e24ee2213210c0183feb9e601d64627f3b1e69b4d82b73790c541b2
4
+ data.tar.gz: 0bad3d93e03750a65406a0ae404a43437e3cc8c5d62149606947634ca3f32f3b
5
5
  SHA512:
6
- metadata.gz: 42f5b50ce38d67b77aec0cf748922586c915b1f8ca5d1d34e55f6bd0fc7a108ad86e6030b028ff5cc838afce10743fd82fb4e7facbedba3bc2da94246b42ec3d
7
- data.tar.gz: bde5eecf3d4a59501123e877b41fe6f3091036d4cacf5da43d16b28a8e46bab275e95f60318069e437cc58f807bd9193a96b2f546bbe55af5f67610f9596d692
6
+ metadata.gz: bcf014767f06cf1a1f9b410619a1de84ac95488d74e05c402277aecd26def128b5a4584c5e9bca9ebba440540cad355e490c159d03326e2d8256459fe569fd04
7
+ data.tar.gz: 869a1f31a3d2268df76565ea4c6daf012cf17aebb02b7332067dd28b6f0087dd8b09568816fc1ae7e04fe475306d798ee6c3cbc315c1e03d768a212314557c31
@@ -0,0 +1,10 @@
1
+
2
+
3
+ ## 1.5.0
4
+ * refactor extract_words_with_n_grams so it doesn't rely on ngramify #22
5
+
6
+ https://github.com/baxter2
7
+
8
+ * Add rake task that opens an irb session preloaded with sentimental.rb #21
9
+
10
+ https://github.com/baxter2
data/Rakefile CHANGED
@@ -4,3 +4,8 @@ require 'rspec/core/rake_task'
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task default: :spec
7
+
8
+ desc "Open an irb session preloaded with sentimental.rb"
9
+ task :console do
10
+ exec "irb -r sentimental -I ./lib"
11
+ end
@@ -91,16 +91,9 @@ class Sentimental
91
91
 
92
92
  def extract_words_with_n_grams(string)
93
93
  words = extract_words(string)
94
- (1..ngrams).to_a.map do |ngram_size|
95
- ngramify(words, ngram_size)
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'sentimental'
3
- spec.version = '1.4.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.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: 2016-12-26 00:00:00.000000000 Z
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
- rubyforge_project:
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