highscore 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,7 +15,7 @@ module Highscore
15
15
  # @param pattern Regex
16
16
  # @return Highscore::Keywords
17
17
  def self.find_keywords content, wordlist, pattern=/\w+/
18
- keywords = content.to_s.scan(pattern)
18
+ keywords = content.to_s.scan(pattern).flatten
19
19
  keywords.delete_if do |key, value|
20
20
  if wordlist.kind_of? Highscore::Blacklist
21
21
  wordlist.include?(key.downcase)
@@ -60,6 +60,14 @@ class TestContent < Test::Unit::TestCase
60
60
  assert_equal 2, keywords.length
61
61
  end
62
62
 
63
+ def test_concat_word_pattern_groups
64
+ keywords = 'foo Ruby foo Ruby'.keywords do
65
+ set :word_pattern, /(?=(\b\w+\s\w+\b))/
66
+ end
67
+
68
+ assert keywords.collect(&:text).include? 'foo Ruby'
69
+ end
70
+
63
71
  def test_ignore_case
64
72
  keywords = 'foo Foo bar Bar'.keywords do
65
73
  set :ignore_case, true
data/version.txt CHANGED
@@ -1 +1 @@
1
- 0.5.2
1
+ 0.5.3
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: highscore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-25 00:00:00.000000000 Z
12
+ date: 2012-03-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bones
16
- requirement: &70144626889800 !ruby/object:Gem::Requirement
16
+ requirement: &70276433082620 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 3.7.3
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70144626889800
24
+ version_requirements: *70276433082620
25
25
  description: Easily find and rank keywords in long texts.
26
26
  email: liebler.dominik@googlemail.com
27
27
  executables: