matlock 0.1.1 → 0.1.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.
@@ -47,7 +47,7 @@ class Matlock
47
47
  names = []
48
48
 
49
49
  # Split content into words.
50
- words = content.split(/[^-a-z0-9]+/i).select {|v| v.index(/^[-a-z]+$/i)}
50
+ words = content.split(/[^-_a-z0-9]+/i).select {|v| v.index(/^[-a-z]+$/i)}
51
51
 
52
52
  # Loop over each bigram and check if the words are title cased and if at
53
53
  # least one of the words is a first or last name.
@@ -1,3 +1,3 @@
1
1
  class Matlock
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -27,4 +27,10 @@ class TestMatlock < MiniTest::Unit::TestCase
27
27
  names = @matlock.extract_names(html)
28
28
  assert_equal ["Delloreen Ennis-London"], names
29
29
  end
30
+
31
+ def test_name_underscored_names
32
+ html = "This name Wally_Bullingotn_Practice_Complex should not work."
33
+ names = @matlock.extract_names(html)
34
+ assert_equal [], names
35
+ end
30
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matlock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: