text_rank 1.2.0 → 1.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7c140fafc459b538cdc9fcc84f639e2155c6fbb
4
- data.tar.gz: c2e8b24f80414a113ba9d2d93ca26b6a7e1c38a8
3
+ metadata.gz: c85bbfaae9efcfbcb5822d1238c027dc86081ce7
4
+ data.tar.gz: c5630457c205457c26e343aa6b9ccea48cdfbbff
5
5
  SHA512:
6
- metadata.gz: ab7b1875f82d42a51243f74b827f90dc0e23b3ad68479b7dca4a78058423bf63e74d50361c952809e1396ddc70423fbafcee090344bbb47cd5095f94cd09e435
7
- data.tar.gz: 7fb37752476eb9f0fefab815af32522eb3a748bb39fdeace39af08446c9a6e544c96fe187bcf541c27947493d6c7aafd69351af1c6a6438f987926396189adde
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, _|
@@ -1,4 +1,4 @@
1
1
  module TextRank
2
2
  # Current gem version
3
- VERSION = '1.2.0'
3
+ VERSION = '1.2.2'
4
4
  end
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.0
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: 2016-10-19 00:00:00.000000000 Z
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.6.7
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