namae 0.8.6 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/lists.feature +8 -2
- data/lib/namae/parser.rb +2 -2
- data/lib/namae/parser.y +2 -2
- data/lib/namae/version.rb +1 -1
- data/namae.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4340f8745ce9d99b766c7b97f5b622b5ae8c9e2f
|
4
|
+
data.tar.gz: ce330d12fa284b820121735722bfd24f31837cff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1572cf9924176829e68b70ed94a485528ce13808e571cdfb3e2f77ad962a204d5d27520c3975c8012cdd0d93702fd0ec3a26ed10f09a4651ec079f2d2e756c1d
|
7
|
+
data.tar.gz: 8cd73bc608b791c66b2504d1b4a598d4742d0ba1fb9e67b6e11e9bfafb32f35b0776b6e2e6bd9ba81a655327ee3489e47e8b6b5cc025a56f5c20d54ff063ecb4
|
data/features/lists.feature
CHANGED
@@ -62,17 +62,23 @@ Feature: Parse a list of names
|
|
62
62
|
| Dennis | Ritchie |
|
63
63
|
| Donald | Knuth |
|
64
64
|
|
65
|
-
@list
|
65
|
+
@list @wip
|
66
66
|
Scenario: A list of names separated by commas
|
67
67
|
Given a parser that prefers commas as separators
|
68
68
|
When I parse the names "G. Proctor, M. Cooper, P. Sanders & B. Malcom"
|
69
|
-
# Then there should be 4 names
|
70
69
|
Then the names should be:
|
71
70
|
| given | family |
|
72
71
|
| G. | Proctor |
|
73
72
|
| M. | Cooper |
|
74
73
|
| P. | Sanders |
|
75
74
|
| B. | Malcom |
|
75
|
+
When I parse the names "G Proctor, M Cooper, PJ Sanders & B Malcom"
|
76
|
+
Then the names should be:
|
77
|
+
| given | family |
|
78
|
+
| G | Proctor |
|
79
|
+
| M | Cooper |
|
80
|
+
| PJ | Sanders |
|
81
|
+
| B | Malcom |
|
76
82
|
|
77
83
|
Scenario: A list of names with particles separated by commas
|
78
84
|
Given a parser that prefers commas as separators
|
data/lib/namae/parser.rb
CHANGED
@@ -107,7 +107,7 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 98)
|
|
107
107
|
|
108
108
|
case type
|
109
109
|
when :UWORD
|
110
|
-
@initials += 1 if word =~
|
110
|
+
@initials += 1 if word =~ /^[[:upper:]]+\b/
|
111
111
|
when :SUFFIX
|
112
112
|
@suffices += 1
|
113
113
|
end
|
@@ -128,7 +128,7 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 98)
|
|
128
128
|
end
|
129
129
|
|
130
130
|
def will_see_initial?
|
131
|
-
input.peek(6).to_s.strip.split(/\s+/)[0] =~ /^[[:
|
131
|
+
input.peek(6).to_s.strip.split(/\s+/)[0] =~ /^[[:upper:]]+\b/
|
132
132
|
end
|
133
133
|
|
134
134
|
def seen_full_name?
|
data/lib/namae/parser.y
CHANGED
@@ -189,7 +189,7 @@ require 'strscan'
|
|
189
189
|
|
190
190
|
case type
|
191
191
|
when :UWORD
|
192
|
-
@initials += 1 if word =~
|
192
|
+
@initials += 1 if word =~ /^[[:upper:]]+\b/
|
193
193
|
when :SUFFIX
|
194
194
|
@suffices += 1
|
195
195
|
end
|
@@ -210,7 +210,7 @@ require 'strscan'
|
|
210
210
|
end
|
211
211
|
|
212
212
|
def will_see_initial?
|
213
|
-
input.peek(6).to_s.strip.split(/\s+/)[0] =~ /^[[:
|
213
|
+
input.peek(6).to_s.strip.split(/\s+/)[0] =~ /^[[:upper:]]+\b/
|
214
214
|
end
|
215
215
|
|
216
216
|
def seen_full_name?
|
data/lib/namae/version.rb
CHANGED
data/namae.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: namae 0.8.
|
5
|
+
# stub: namae 0.8.7 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "namae"
|
9
|
-
s.version = "0.8.
|
9
|
+
s.version = "0.8.7"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Sylvester Keil", "Dan Collis-Puro"]
|
14
|
-
s.date = "2014-05-
|
14
|
+
s.date = "2014-05-14"
|
15
15
|
s.description = " Namae (\u{540d}\u{524d}) is a parser for human names. It recognizes personal names of various cultural backgrounds and tries to split them into their component parts (e.g., given and family names, honorifics etc.). "
|
16
16
|
s.email = ["sylvester@keil.or.at", "dan@collispuro.com"]
|
17
17
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: namae
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvester Keil
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-05-
|
12
|
+
date: 2014-05-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: simplecov
|