text_rank 1.2.0 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/text_rank/rank_filter/collapse_adjacent.rb +5 -1
- data/lib/text_rank/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c85bbfaae9efcfbcb5822d1238c027dc86081ce7
|
4
|
+
data.tar.gz: c5630457c205457c26e343aa6b9ccea48cdfbbff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0b5388fd3343c1cdb511aa651a0d30ac99cd4ddf767344e1c2005458d146658e8a51b1da8f27d8b1b55b353df57a7898149591e2cc029413c6318e0c2cbe558
|
7
|
+
data.tar.gz: b3b1ba40ccfe6da5c43262fa0cbe71603c750336662a67ee383d603a86e4837ebce47f229b63167d008d076eb96346d79a991074ffd7ad18cdd9be2cc614b215
|
@@ -114,7 +114,11 @@ module TextRank
|
|
114
114
|
# We now know what to collapse and what to remove, so we can start safely
|
115
115
|
# modifying the tokens hash
|
116
116
|
@to_collapse.each do |perm|
|
117
|
-
values = @tokens.values_at(*perm)
|
117
|
+
values = @tokens.values_at(*perm).compact
|
118
|
+
# This might be empty if somehow the scanned permutation doesn't
|
119
|
+
# exactly match one of the tokens (e.g. ASCII-folding gone awry).
|
120
|
+
# The goal is to do the best we can, so if we can't find it, ignore.
|
121
|
+
next if values.empty?
|
118
122
|
@tokens[perm.join(@delimiter)] = values.reduce(:+) / values.size
|
119
123
|
end
|
120
124
|
@tokens.reject! do |k, _|
|
data/lib/text_rank/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: text_rank
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David McCullars
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -183,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
183
|
version: '0'
|
184
184
|
requirements: []
|
185
185
|
rubyforge_project:
|
186
|
-
rubygems_version: 2.
|
186
|
+
rubygems_version: 2.5.1
|
187
187
|
signing_key:
|
188
188
|
specification_version: 4
|
189
189
|
summary: Implementation of TextRank solution to ranked keyword extraction
|