namae 0.7.1 → 0.8.0
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 +7 -0
- data/.travis.yml +1 -0
- data/AGPL +2 -1
- data/BSDL +2 -1
- data/Gemfile +9 -10
- data/README.md +14 -0
- data/Rakefile +6 -2
- data/features/bibtex.feature +3 -3
- data/features/examples.feature +10 -7
- data/features/suffix.feature +31 -31
- data/lib/namae/name.rb +14 -2
- data/lib/namae/parser.rb +165 -113
- data/lib/namae/parser.y +37 -25
- data/lib/namae/version.rb +3 -3
- data/namae.gemspec +10 -10
- data/spec/namae/parser_spec.rb +23 -1
- metadata +24 -39
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2a99f6d608d0f0a94a3235e2a00e1bd8403913c5
|
4
|
+
data.tar.gz: f9efce4cd6dbcfc5c0b7d6d7a29a058a2849ec58
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 87611448553830c290b1ff250d65390b17ac4a7217e9e12f71f30a14866b82a46bd79650d4810dc21cdb90a219fccc471ffd2025de8e640d0d1ecbb098937877
|
7
|
+
data.tar.gz: 6310b836f15d5b09df3ed821d39d9e558a463476fa7b6fecde76dd3b1a20305d653776a2923e01d0c890c4c75273de2671f7d6b48c010111e60c3bc082f30808
|
data/.travis.yml
CHANGED
data/AGPL
CHANGED
@@ -629,8 +629,9 @@ to attach them to the start of each source file to most effectively
|
|
629
629
|
state the exclusion of warranty; and each file should have at least
|
630
630
|
the "copyright" line and a pointer to where the full notice is found.
|
631
631
|
|
632
|
-
Namae. A personal name parser
|
632
|
+
Namae. A personal name parser.
|
633
633
|
Copyright (C) 2012 President and Fellows of Harvard College
|
634
|
+
Copyright (C) 2013 Sylvester Keil
|
634
635
|
|
635
636
|
This program is free software: you can redistribute it and/or modify
|
636
637
|
it under the terms of the GNU Affero General Public License as published by
|
data/BSDL
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
Namae. A personal name parser
|
1
|
+
Namae. A personal name parser.
|
2
2
|
Copyright (C) 2012 President and Fellows of Harvard College
|
3
|
+
Copyright (C) 2013 Sylvester Keil
|
3
4
|
|
4
5
|
Redistribution and use in source and binary forms, with or without
|
5
6
|
modification, are permitted provided that the following conditions are met:
|
data/Gemfile
CHANGED
@@ -1,24 +1,23 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
group :test do
|
4
|
-
gem 'rspec'
|
5
|
-
gem 'rake'
|
6
|
-
gem 'cucumber'
|
7
|
-
gem 'yard', '~> 0.7'
|
4
|
+
gem 'rspec'
|
5
|
+
gem 'rake'
|
6
|
+
gem 'cucumber'
|
8
7
|
end
|
9
8
|
|
10
9
|
group :development do
|
11
|
-
gem 'racc', '~> 1.4.8', :platform => [:
|
12
|
-
gem 'bundler', '~> 1.1'
|
10
|
+
gem 'racc', '~> 1.4.8', :platform => [:ruby_20, :ruby_19, :ruby_18]
|
13
11
|
gem 'simplecov', :require => false
|
14
|
-
gem 'ZenTest'
|
12
|
+
gem 'ZenTest'
|
15
13
|
gem 'jeweler', '~> 1.8.3'
|
14
|
+
gem 'yard'
|
16
15
|
end
|
17
16
|
|
18
17
|
group :debug do
|
19
|
-
gem 'debugger', '~> 1.1.3', :platform => :mri_19
|
18
|
+
gem 'debugger', '~> 1.1.3', :platform => [:mri_19]
|
20
19
|
end
|
21
20
|
|
22
21
|
group :osx do
|
23
22
|
gem 'autotest-fsevent'
|
24
|
-
end
|
23
|
+
end
|
data/README.md
CHANGED
@@ -90,6 +90,15 @@ names are written in display-order:
|
|
90
90
|
Namae.parse 'Prof. Donald Ervin Knuth'
|
91
91
|
#-> [#<Name family="Knuth" given="Donald Ervin" title="Prof.">]
|
92
92
|
|
93
|
+
Namae.parse 'Ms. Sofia Kovaleskaya'
|
94
|
+
#-> [#<Name family="Kovaleskaya" given="Sofia" appellation="Ms.">]
|
95
|
+
|
96
|
+
Namae.parse 'Countess Ada Lovelace'
|
97
|
+
#-> [#<Name family="Lovelace" given="Ada" title="Countess">]
|
98
|
+
|
99
|
+
Namae.parse 'Ken Griffey Jr.'
|
100
|
+
#-> [#<Name family="Griffey" given="Ken" suffix="Jr.">]
|
101
|
+
|
93
102
|
Or in sort-order:
|
94
103
|
|
95
104
|
Namae.parse 'Turing, Alan M.'
|
@@ -153,8 +162,13 @@ Contributors
|
|
153
162
|
* [Sylvester Keil](http://sylvester.keil.or.at)
|
154
163
|
* Dan Collis-Puro
|
155
164
|
|
165
|
+
Credits
|
166
|
+
-------
|
167
|
+
Namae was written as a part of a Google Summer of Code project. Thanks Google!
|
168
|
+
|
156
169
|
Copyright
|
157
170
|
---------
|
158
171
|
Copyright (c) 2012 President and Fellows of Harvard College.
|
172
|
+
Copyright (c) 2013 Sylvester Keil
|
159
173
|
|
160
174
|
Namae is dual licensed under the AGPL and a BSD-style license.
|
data/Rakefile
CHANGED
data/features/bibtex.feature
CHANGED
@@ -40,9 +40,9 @@ Feature: Parse BibTeX-style names
|
|
40
40
|
| bb CC dd EE, AA | AA | bb CC dd | EE | |
|
41
41
|
| bb, AA | AA | | bb | |
|
42
42
|
| BB, | | | BB | |
|
43
|
-
| bb CC,
|
44
|
-
| bb CC,
|
45
|
-
| BB,, AA | AA | | BB | |
|
43
|
+
| bb CC,II, AA | AA | bb | CC | II |
|
44
|
+
| bb CC,jr, AA | AA | bb | CC | jr |
|
45
|
+
# | BB,, AA | AA | | BB | |
|
46
46
|
| CC dd BB, AA | AA | CC dd | BB | |
|
47
47
|
| BB, AA | AA | | BB | |
|
48
48
|
|
data/features/examples.feature
CHANGED
@@ -10,13 +10,16 @@ Feature: Parse the names in the Readme file
|
|
10
10
|
|
11
11
|
@readme @display
|
12
12
|
Scenarios: Readme examples (display-order)
|
13
|
-
| name | given | particle | family
|
14
|
-
| Charles Babbage | Charles | | Babbage
|
15
|
-
| Mr. Alan M. Turing | Alan M. | | Turing
|
16
|
-
| Yukihiro "Matz" Matsumoto | Yukihiro | | Matsumoto
|
17
|
-
| Sir Isaac Newton | Isaac | | Newton
|
18
|
-
| Prof. Donald Ervin Knuth | Donald Ervin | | Knuth
|
19
|
-
| Lord Byron | | | Byron
|
13
|
+
| name | given | particle | family | suffix | title | appellation | nick |
|
14
|
+
| Charles Babbage | Charles | | Babbage | | | | |
|
15
|
+
| Mr. Alan M. Turing | Alan M. | | Turing | | | Mr. | |
|
16
|
+
| Yukihiro "Matz" Matsumoto | Yukihiro | | Matsumoto | | | | Matz |
|
17
|
+
| Sir Isaac Newton | Isaac | | Newton | | Sir | | |
|
18
|
+
| Prof. Donald Ervin Knuth | Donald Ervin | | Knuth | | Prof. | | |
|
19
|
+
| Lord Byron | | | Byron | | Lord | | |
|
20
|
+
| Ms. Sofia Kovalevskaya | Sofia | | Kovalevskaya | | | Ms. | |
|
21
|
+
| Countess Ada Lovelace | Ada | | Lovelace | | Countess | | |
|
22
|
+
| Augusta Ada King | Augusta Ada | | King | | | | |
|
20
23
|
|
21
24
|
@readme @sort
|
22
25
|
Scenarios: Readme examples (sort-order)
|
data/features/suffix.feature
CHANGED
@@ -9,34 +9,34 @@ Feature: Parse names with a suffix
|
|
9
9
|
| given | family | suffix |
|
10
10
|
| Ken | Griffey | Jr. |
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
12
|
+
@names @suffix
|
13
|
+
Scenario: Names with a suffix in display-order
|
14
|
+
When I parse the names "Ken Griffey, Jr."
|
15
|
+
Then the names should be:
|
16
|
+
| given | family | suffix |
|
17
|
+
| Ken | Griffey | Jr. |
|
18
|
+
|
19
|
+
@names @suffix
|
20
|
+
Scenario: Names with a suffix in sort-order chicago style
|
21
|
+
When I parse the names "Griffey, Ken, Jr."
|
22
|
+
Then the names should be:
|
23
|
+
| given | family | suffix |
|
24
|
+
| Ken | Griffey | Jr. |
|
25
|
+
|
26
|
+
@names @suffix
|
27
|
+
Scenario: Names with a suffix in display-order no comma
|
28
|
+
When I parse the names "Ken Griffey Jr."
|
29
|
+
Then the names should be:
|
30
|
+
| given | family | suffix |
|
31
|
+
| Ken | Griffey | Jr. |
|
32
|
+
|
33
|
+
|
34
|
+
@names @suffix @list
|
35
|
+
Scenario: Names with a suffix
|
36
|
+
When I parse the names "Griffey, Jr., Ken and Ken Griffey, Jr. and Griffey, Ken, Jr. and Ken Griffey Jr."
|
37
|
+
Then the names should be:
|
38
|
+
| given | family | suffix |
|
39
|
+
| Ken | Griffey | Jr. |
|
40
|
+
| Ken | Griffey | Jr. |
|
41
|
+
| Ken | Griffey | Jr. |
|
42
|
+
| Ken | Griffey | Jr. |
|
data/lib/namae/name.rb
CHANGED
@@ -46,10 +46,22 @@ module Namae
|
|
46
46
|
|
47
47
|
|
48
48
|
# @param attributes [Hash] the individual parts of the name
|
49
|
+
# @param sanitize [Boolean] whether or not to apply extra
|
50
|
+
# sanitation rules
|
49
51
|
# @example
|
50
52
|
# Name.new(:family => 'Matsumoto')
|
51
|
-
def initialize(attributes = {})
|
53
|
+
def initialize(attributes = {}, sanitize = false)
|
52
54
|
super(*attributes.values_at(*Name.parts))
|
55
|
+
|
56
|
+
if sanitize && suffix && !given && family
|
57
|
+
tokens = family.split(/\s+/)
|
58
|
+
|
59
|
+
# Display-order plus comma suffix special case
|
60
|
+
if tokens.length > 1
|
61
|
+
self.family = tokens.pop
|
62
|
+
self.given = tokens.join(' ')
|
63
|
+
end
|
64
|
+
end
|
53
65
|
end
|
54
66
|
|
55
67
|
# @return [String] the name in sort order
|
@@ -142,4 +154,4 @@ module Namae
|
|
142
154
|
end
|
143
155
|
|
144
156
|
end
|
145
|
-
end
|
157
|
+
end
|
data/lib/namae/parser.rb
CHANGED
@@ -12,7 +12,7 @@ require 'strscan'
|
|
12
12
|
module Namae
|
13
13
|
class Parser < Racc::Parser
|
14
14
|
|
15
|
-
module_eval(<<'...end parser.y/module_eval...', 'parser.y',
|
15
|
+
module_eval(<<'...end parser.y/module_eval...', 'parser.y', 97)
|
16
16
|
|
17
17
|
include Singleton
|
18
18
|
|
@@ -24,8 +24,8 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 90)
|
|
24
24
|
:prefer_comma_as_separator => false,
|
25
25
|
:comma => ',',
|
26
26
|
:separator => /\s*(\band\b|\&)\s*/i,
|
27
|
-
:title => /\s*\b(sir|lord|(prof|dr|md|ph\.?d)\.?)(\s+|$)/i,
|
28
|
-
:suffix => /\s*\b(jr|sr|[
|
27
|
+
:title => /\s*\b(sir|lord|count(ess)?|(prof|dr|md|ph\.?d)\.?)(\s+|$)/i,
|
28
|
+
:suffix => /\s*\b(JR|Jr|jr|SR|Sr|sr|[IVX]{2,})(\.|\b)/,
|
29
29
|
:appellation => /\s*\b((mrs?|ms|fr|hr)\.?|miss|herr|frau)(\s+|$)/i
|
30
30
|
}
|
31
31
|
end
|
@@ -77,7 +77,7 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 90)
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def reset
|
80
|
-
@commas, @words, @initials, @yydebug = 0, 0, 0, debug?
|
80
|
+
@commas, @words, @initials, @suffices, @yydebug = 0, 0, 0, 0, debug?
|
81
81
|
self
|
82
82
|
end
|
83
83
|
|
@@ -93,7 +93,7 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 90)
|
|
93
93
|
|
94
94
|
def consume_separator
|
95
95
|
return next_token if seen_separator?
|
96
|
-
@commas, @words, @initials = 0, 0, 0
|
96
|
+
@commas, @words, @initials, @suffices = 0, 0, 0, 0
|
97
97
|
[:AND, :AND]
|
98
98
|
end
|
99
99
|
|
@@ -104,7 +104,14 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 90)
|
|
104
104
|
|
105
105
|
def consume_word(type, word)
|
106
106
|
@words += 1
|
107
|
-
|
107
|
+
|
108
|
+
case type
|
109
|
+
when :UWORD
|
110
|
+
@initials += 1 if word =~ /^\s*[[:alpha:]]\.\s*$/
|
111
|
+
when :SUFFIX
|
112
|
+
@suffices += 1
|
113
|
+
end
|
114
|
+
|
108
115
|
[type, word]
|
109
116
|
end
|
110
117
|
|
@@ -113,12 +120,7 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 90)
|
|
113
120
|
end
|
114
121
|
|
115
122
|
def suffix?
|
116
|
-
|
117
|
-
end
|
118
|
-
|
119
|
-
def seen_suffix?
|
120
|
-
return false unless stack.length > 1
|
121
|
-
last_token == :COMMA || last_token =~ suffix
|
123
|
+
!@suffices.zero? || will_see_suffix?
|
122
124
|
end
|
123
125
|
|
124
126
|
def will_see_suffix?
|
@@ -130,7 +132,8 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 90)
|
|
130
132
|
end
|
131
133
|
|
132
134
|
def seen_full_name?
|
133
|
-
prefer_comma_as_separator? && @words > 1 &&
|
135
|
+
prefer_comma_as_separator? && @words > 1 &&
|
136
|
+
(@initials > 0 || !will_see_initial?) && !will_see_suffix?
|
134
137
|
end
|
135
138
|
|
136
139
|
def next_token
|
@@ -149,6 +152,8 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 90)
|
|
149
152
|
next_token
|
150
153
|
when input.scan(title)
|
151
154
|
consume_word(:TITLE, input.matched.strip)
|
155
|
+
when input.scan(suffix)
|
156
|
+
consume_word(:SUFFIX, input.matched.strip)
|
152
157
|
when input.scan(appellation)
|
153
158
|
[:APPELLATION, input.matched.strip]
|
154
159
|
when input.scan(/((\\\w+)?\{[^\}]*\})*[[:upper:]][^\s#{comma}]*/)
|
@@ -177,105 +182,121 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 90)
|
|
177
182
|
##### State transition tables begin ###
|
178
183
|
|
179
184
|
racc_action_table = [
|
180
|
-
-
|
181
|
-
-36, -
|
182
|
-
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
185
|
+
-36, -38, -37, 58, 30, 62, 31, -36, -38, -37,
|
186
|
+
-36, -38, -37, 56, -22, 56, -22, 53, 52, 54,
|
187
|
+
-36, -22, -22, -22, 39, 16, 39, -36, 33, 39,
|
188
|
+
-22, 32, 17, 53, 52, 54, 53, 52, 54, 56,
|
189
|
+
39, 45, nil, 39, 14, 12, 15, nil, nil, 7,
|
190
|
+
8, 14, 12, 15, nil, nil, 7, 8, 14, 22,
|
191
|
+
15, 24, 60, 53, 52, 54, 14, 22, 15, 24,
|
192
|
+
30, 46, 31, 53, 52, 54, 30, 28, 31, 30,
|
193
|
+
28, 31, 30, 42, 31, 30, 28, 31, 30, 28,
|
194
|
+
31, 30, 28, 31, 14, 22, 15, 53, 52, 54 ]
|
188
195
|
|
189
196
|
racc_action_check = [
|
190
|
-
22,
|
191
|
-
|
192
|
-
12,
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
197
|
+
22, 15, 14, 44, 43, 50, 43, 22, 15, 14,
|
198
|
+
22, 15, 14, 50, 28, 38, 28, 32, 32, 32,
|
199
|
+
12, 28, 12, 42, 32, 1, 23, 12, 16, 60,
|
200
|
+
42, 11, 1, 58, 58, 58, 45, 45, 45, 64,
|
201
|
+
58, 27, nil, 45, 0, 0, 0, nil, nil, 0,
|
202
|
+
0, 17, 17, 17, nil, nil, 17, 17, 20, 20,
|
203
|
+
20, 20, 49, 49, 49, 49, 9, 9, 9, 9,
|
204
|
+
29, 29, 29, 62, 62, 62, 10, 10, 10, 25,
|
205
|
+
25, 25, 24, 24, 24, 35, 35, 35, 21, 21,
|
206
|
+
21, 41, 41, 41, 5, 5, 5, 65, 65, 65 ]
|
198
207
|
|
199
208
|
racc_action_pointer = [
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
nil, nil,
|
204
|
-
|
205
|
-
nil, nil, nil,
|
209
|
+
41, 25, nil, nil, nil, 91, nil, nil, nil, 63,
|
210
|
+
73, 29, 20, nil, 2, 1, 28, 48, nil, nil,
|
211
|
+
55, 85, 0, 16, 79, 76, nil, 39, 14, 67,
|
212
|
+
nil, nil, 14, nil, nil, 82, nil, nil, 5, nil,
|
213
|
+
nil, 88, 23, 1, 1, 33, nil, nil, nil, 60,
|
214
|
+
3, nil, nil, nil, nil, nil, nil, nil, 30, nil,
|
215
|
+
19, nil, 70, nil, 29, 94 ]
|
206
216
|
|
207
217
|
racc_action_default = [
|
208
|
-
-1, -
|
209
|
-
-
|
210
|
-
-
|
211
|
-
-
|
212
|
-
-
|
213
|
-
-
|
218
|
+
-1, -43, -2, -4, -5, -43, -8, -9, -10, -23,
|
219
|
+
-43, -43, -19, -28, -30, -31, -43, -43, -6, -7,
|
220
|
+
-43, -43, -19, -39, -43, -43, -29, -15, -20, -23,
|
221
|
+
-30, -31, -34, 66, -3, -43, -15, -11, -40, -41,
|
222
|
+
-12, -43, -19, -23, -14, -34, -21, -16, -24, -35,
|
223
|
+
-26, -32, -36, -37, -38, -14, -42, -13, -34, -17,
|
224
|
+
-43, -33, -43, -18, -25, -27 ]
|
214
225
|
|
215
226
|
racc_goto_table = [
|
216
|
-
3,
|
217
|
-
|
218
|
-
23,
|
219
|
-
nil, nil,
|
220
|
-
|
227
|
+
3, 38, 26, 65, 27, 18, 9, 2, 47, 23,
|
228
|
+
37, 20, 21, 26, 19, 36, 25, 3, 40, 44,
|
229
|
+
23, 59, 26, 9, 34, 1, nil, 35, nil, 55,
|
230
|
+
43, 41, nil, nil, 63, 57, 26, nil, 64, nil,
|
231
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, 61,
|
232
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
233
|
+
nil, nil, nil, nil, nil, 61 ]
|
221
234
|
|
222
235
|
racc_goto_check = [
|
223
|
-
3,
|
224
|
-
|
225
|
-
3,
|
226
|
-
nil, nil,
|
227
|
-
|
236
|
+
3, 14, 15, 13, 9, 3, 7, 2, 11, 3,
|
237
|
+
8, 7, 10, 15, 4, 9, 10, 3, 9, 9,
|
238
|
+
3, 11, 15, 7, 2, 1, nil, 10, nil, 9,
|
239
|
+
7, 10, nil, nil, 11, 9, 15, nil, 14, nil,
|
240
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, 3,
|
241
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
242
|
+
nil, nil, nil, nil, nil, 3 ]
|
228
243
|
|
229
244
|
racc_goto_pointer = [
|
230
|
-
nil,
|
231
|
-
-
|
245
|
+
nil, 25, 7, 0, 9, nil, nil, 6, -13, -6,
|
246
|
+
7, -24, nil, -59, -22, -7 ]
|
232
247
|
|
233
248
|
racc_goto_default = [
|
234
|
-
nil, nil, nil,
|
235
|
-
nil,
|
249
|
+
nil, nil, nil, 51, 4, 5, 6, 29, nil, 11,
|
250
|
+
10, nil, 48, 49, 50, 13 ]
|
236
251
|
|
237
252
|
racc_reduce_table = [
|
238
253
|
0, 0, :racc_error,
|
239
|
-
0,
|
240
|
-
1,
|
241
|
-
3,
|
242
|
-
1,
|
243
|
-
1, 12, :_reduce_none,
|
244
|
-
2, 12, :_reduce_6,
|
245
|
-
2, 12, :_reduce_7,
|
246
|
-
1, 12, :_reduce_none,
|
247
|
-
1, 15, :_reduce_9,
|
248
|
-
1, 15, :_reduce_10,
|
249
|
-
2, 14, :_reduce_11,
|
250
|
-
3, 14, :_reduce_12,
|
251
|
-
4, 14, :_reduce_13,
|
252
|
-
3, 14, :_reduce_14,
|
253
|
-
2, 14, :_reduce_15,
|
254
|
-
3, 16, :_reduce_16,
|
255
|
-
4, 16, :_reduce_17,
|
256
|
-
5, 16, :_reduce_18,
|
257
|
-
1, 19, :_reduce_none,
|
258
|
-
2, 19, :_reduce_20,
|
259
|
-
3, 19, :_reduce_21,
|
260
|
-
1, 18, :_reduce_none,
|
261
|
-
1, 18, :_reduce_none,
|
262
|
-
1, 20, :_reduce_24,
|
263
|
-
3, 20, :_reduce_25,
|
264
|
-
1, 17, :_reduce_none,
|
265
|
-
2, 17, :_reduce_27,
|
266
|
-
1, 22, :_reduce_none,
|
267
|
-
1, 22, :_reduce_none,
|
268
|
-
1, 23, :_reduce_none,
|
269
|
-
2, 23, :_reduce_31,
|
270
|
-
0, 21, :_reduce_none,
|
271
|
-
1, 21, :_reduce_none,
|
254
|
+
0, 12, :_reduce_1,
|
255
|
+
1, 12, :_reduce_2,
|
256
|
+
3, 12, :_reduce_3,
|
257
|
+
1, 13, :_reduce_4,
|
272
258
|
1, 13, :_reduce_none,
|
259
|
+
2, 13, :_reduce_6,
|
260
|
+
2, 13, :_reduce_7,
|
273
261
|
1, 13, :_reduce_none,
|
274
|
-
1,
|
262
|
+
1, 16, :_reduce_9,
|
263
|
+
1, 16, :_reduce_10,
|
264
|
+
3, 15, :_reduce_11,
|
265
|
+
3, 15, :_reduce_12,
|
266
|
+
4, 15, :_reduce_13,
|
267
|
+
3, 15, :_reduce_14,
|
268
|
+
2, 15, :_reduce_15,
|
269
|
+
3, 17, :_reduce_16,
|
270
|
+
4, 17, :_reduce_17,
|
271
|
+
5, 17, :_reduce_18,
|
272
|
+
1, 21, :_reduce_none,
|
273
|
+
2, 21, :_reduce_20,
|
274
|
+
3, 21, :_reduce_21,
|
275
|
+
1, 20, :_reduce_none,
|
276
|
+
1, 20, :_reduce_none,
|
277
|
+
1, 22, :_reduce_24,
|
278
|
+
3, 22, :_reduce_25,
|
279
|
+
1, 22, :_reduce_26,
|
280
|
+
3, 22, :_reduce_27,
|
281
|
+
1, 18, :_reduce_none,
|
282
|
+
2, 18, :_reduce_29,
|
283
|
+
1, 26, :_reduce_none,
|
284
|
+
1, 26, :_reduce_none,
|
285
|
+
1, 24, :_reduce_none,
|
286
|
+
2, 24, :_reduce_33,
|
287
|
+
0, 23, :_reduce_none,
|
288
|
+
1, 23, :_reduce_none,
|
289
|
+
1, 14, :_reduce_none,
|
290
|
+
1, 14, :_reduce_none,
|
291
|
+
1, 14, :_reduce_none,
|
292
|
+
0, 19, :_reduce_none,
|
293
|
+
1, 19, :_reduce_none,
|
294
|
+
1, 25, :_reduce_none,
|
295
|
+
2, 25, :_reduce_42 ]
|
275
296
|
|
276
|
-
racc_reduce_n =
|
297
|
+
racc_reduce_n = 43
|
277
298
|
|
278
|
-
racc_shift_n =
|
299
|
+
racc_shift_n = 66
|
279
300
|
|
280
301
|
racc_token_table = {
|
281
302
|
false => 0,
|
@@ -287,9 +308,10 @@ racc_token_table = {
|
|
287
308
|
:NICK => 6,
|
288
309
|
:AND => 7,
|
289
310
|
:APPELLATION => 8,
|
290
|
-
:TITLE => 9
|
311
|
+
:TITLE => 9,
|
312
|
+
:SUFFIX => 10 }
|
291
313
|
|
292
|
-
racc_nt_base =
|
314
|
+
racc_nt_base = 11
|
293
315
|
|
294
316
|
racc_use_result_var = true
|
295
317
|
|
@@ -320,6 +342,7 @@ Racc_token_to_s_table = [
|
|
320
342
|
"AND",
|
321
343
|
"APPELLATION",
|
322
344
|
"TITLE",
|
345
|
+
"SUFFIX",
|
323
346
|
"$start",
|
324
347
|
"names",
|
325
348
|
"name",
|
@@ -328,12 +351,14 @@ Racc_token_to_s_table = [
|
|
328
351
|
"honorific",
|
329
352
|
"sort_order",
|
330
353
|
"u_words",
|
354
|
+
"opt_suffices",
|
331
355
|
"last",
|
332
356
|
"von",
|
333
357
|
"first",
|
334
358
|
"opt_words",
|
335
|
-
"
|
336
|
-
"
|
359
|
+
"words",
|
360
|
+
"suffices",
|
361
|
+
"u_word" ]
|
337
362
|
|
338
363
|
Racc_debug_parser = false
|
339
364
|
|
@@ -403,7 +428,7 @@ module_eval(<<'.,.,', 'parser.y', 21)
|
|
403
428
|
|
404
429
|
module_eval(<<'.,.,', 'parser.y', 25)
|
405
430
|
def _reduce_11(val, _values, result)
|
406
|
-
result = Name.new(:given => val[0], :family => val[1])
|
431
|
+
result = Name.new(:given => val[0], :family => val[1], :suffix => val[2])
|
407
432
|
|
408
433
|
result
|
409
434
|
end
|
@@ -445,8 +470,8 @@ module_eval(<<'.,.,', 'parser.y', 43)
|
|
445
470
|
|
446
471
|
module_eval(<<'.,.,', 'parser.y', 48)
|
447
472
|
def _reduce_16(val, _values, result)
|
448
|
-
result = Name.new(:family => val[0], :suffix => val[2][0],
|
449
|
-
:given => val[2][1])
|
473
|
+
result = Name.new({ :family => val[0], :suffix => val[2][0],
|
474
|
+
:given => val[2][1] }, !!val[2][0])
|
450
475
|
|
451
476
|
result
|
452
477
|
end
|
@@ -454,8 +479,8 @@ module_eval(<<'.,.,', 'parser.y', 48)
|
|
454
479
|
|
455
480
|
module_eval(<<'.,.,', 'parser.y', 53)
|
456
481
|
def _reduce_17(val, _values, result)
|
457
|
-
result = Name.new(:particle => val[0], :family => val[1],
|
458
|
-
:suffix => val[3][0], :given => val[3][1])
|
482
|
+
result = Name.new({ :particle => val[0], :family => val[1],
|
483
|
+
:suffix => val[3][0], :given => val[3][1] }, !!val[3][0])
|
459
484
|
|
460
485
|
result
|
461
486
|
end
|
@@ -463,8 +488,8 @@ module_eval(<<'.,.,', 'parser.y', 53)
|
|
463
488
|
|
464
489
|
module_eval(<<'.,.,', 'parser.y', 58)
|
465
490
|
def _reduce_18(val, _values, result)
|
466
|
-
result = Name.new(:particle => val[0,2].join(' '), :family => val[2],
|
467
|
-
:suffix => val[4][0], :given => val[4][1])
|
491
|
+
result = Name.new({ :particle => val[0,2].join(' '), :family => val[2],
|
492
|
+
:suffix => val[4][0], :given => val[4][1] }, !!val[4][0])
|
468
493
|
|
469
494
|
result
|
470
495
|
end
|
@@ -499,36 +524,46 @@ module_eval(<<'.,.,', 'parser.y', 69)
|
|
499
524
|
|
500
525
|
module_eval(<<'.,.,', 'parser.y', 70)
|
501
526
|
def _reduce_25(val, _values, result)
|
502
|
-
result = [val[
|
527
|
+
result = [val[2],val[0]]
|
503
528
|
result
|
504
529
|
end
|
505
530
|
.,.,
|
506
531
|
|
507
|
-
|
532
|
+
module_eval(<<'.,.,', 'parser.y', 71)
|
533
|
+
def _reduce_26(val, _values, result)
|
534
|
+
result = [val[0],nil]
|
535
|
+
result
|
536
|
+
end
|
537
|
+
.,.,
|
508
538
|
|
509
|
-
module_eval(<<'.,.,', 'parser.y',
|
539
|
+
module_eval(<<'.,.,', 'parser.y', 72)
|
510
540
|
def _reduce_27(val, _values, result)
|
511
|
-
result = val
|
541
|
+
result = [val[0],val[2]]
|
512
542
|
result
|
513
543
|
end
|
514
544
|
.,.,
|
515
545
|
|
516
546
|
# reduce 28 omitted
|
517
547
|
|
518
|
-
|
519
|
-
|
520
|
-
# reduce 30 omitted
|
521
|
-
|
522
|
-
module_eval(<<'.,.,', 'parser.y', 78)
|
523
|
-
def _reduce_31(val, _values, result)
|
548
|
+
module_eval(<<'.,.,', 'parser.y', 75)
|
549
|
+
def _reduce_29(val, _values, result)
|
524
550
|
result = val.join(' ')
|
525
551
|
result
|
526
552
|
end
|
527
553
|
.,.,
|
528
554
|
|
555
|
+
# reduce 30 omitted
|
556
|
+
|
557
|
+
# reduce 31 omitted
|
558
|
+
|
529
559
|
# reduce 32 omitted
|
530
560
|
|
531
|
-
|
561
|
+
module_eval(<<'.,.,', 'parser.y', 80)
|
562
|
+
def _reduce_33(val, _values, result)
|
563
|
+
result = val.join(' ')
|
564
|
+
result
|
565
|
+
end
|
566
|
+
.,.,
|
532
567
|
|
533
568
|
# reduce 34 omitted
|
534
569
|
|
@@ -536,6 +571,23 @@ module_eval(<<'.,.,', 'parser.y', 78)
|
|
536
571
|
|
537
572
|
# reduce 36 omitted
|
538
573
|
|
574
|
+
# reduce 37 omitted
|
575
|
+
|
576
|
+
# reduce 38 omitted
|
577
|
+
|
578
|
+
# reduce 39 omitted
|
579
|
+
|
580
|
+
# reduce 40 omitted
|
581
|
+
|
582
|
+
# reduce 41 omitted
|
583
|
+
|
584
|
+
module_eval(<<'.,.,', 'parser.y', 89)
|
585
|
+
def _reduce_42(val, _values, result)
|
586
|
+
result = val.join(' ')
|
587
|
+
result
|
588
|
+
end
|
589
|
+
.,.,
|
590
|
+
|
539
591
|
def _reduce_none(val, _values, result)
|
540
592
|
val[0]
|
541
593
|
end
|
data/lib/namae/parser.y
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
# -*-
|
1
|
+
# -*- ruby -*-
|
2
2
|
|
3
3
|
class Namae::Parser
|
4
4
|
|
5
|
-
token COMMA UWORD LWORD PWORD NICK AND APPELLATION TITLE
|
5
|
+
token COMMA UWORD LWORD PWORD NICK AND APPELLATION TITLE SUFFIX
|
6
6
|
|
7
7
|
expect 0
|
8
8
|
|
@@ -21,9 +21,9 @@ rule
|
|
21
21
|
honorific : APPELLATION { result = Name.new(:appellation => val[0]) }
|
22
22
|
| TITLE { result = Name.new(:title => val[0]) }
|
23
23
|
|
24
|
-
display_order : u_words word
|
24
|
+
display_order : u_words word opt_suffices
|
25
25
|
{
|
26
|
-
result = Name.new(:given => val[0], :family => val[1])
|
26
|
+
result = Name.new(:given => val[0], :family => val[1], :suffix => val[2])
|
27
27
|
}
|
28
28
|
| u_words NICK last
|
29
29
|
{
|
@@ -46,18 +46,18 @@ rule
|
|
46
46
|
|
47
47
|
sort_order : last COMMA first
|
48
48
|
{
|
49
|
-
result = Name.new(:family => val[0], :suffix => val[2][0],
|
50
|
-
:given => val[2][1])
|
49
|
+
result = Name.new({ :family => val[0], :suffix => val[2][0],
|
50
|
+
:given => val[2][1] }, !!val[2][0])
|
51
51
|
}
|
52
52
|
| von last COMMA first
|
53
53
|
{
|
54
|
-
result = Name.new(:particle => val[0], :family => val[1],
|
55
|
-
:suffix => val[3][0], :given => val[3][1])
|
54
|
+
result = Name.new({ :particle => val[0], :family => val[1],
|
55
|
+
:suffix => val[3][0], :given => val[3][1] }, !!val[3][0])
|
56
56
|
}
|
57
57
|
| u_words von last COMMA first
|
58
58
|
{
|
59
|
-
result = Name.new(:particle => val[0,2].join(' '), :family => val[2],
|
60
|
-
:suffix => val[4][0], :given => val[4][1])
|
59
|
+
result = Name.new({ :particle => val[0,2].join(' '), :family => val[2],
|
60
|
+
:suffix => val[4][0], :given => val[4][1] }, !!val[4][0])
|
61
61
|
}
|
62
62
|
;
|
63
63
|
|
@@ -67,8 +67,10 @@ rule
|
|
67
67
|
|
68
68
|
last : LWORD | u_words
|
69
69
|
|
70
|
-
first : opt_words
|
71
|
-
|
|
70
|
+
first : opt_words { result = [nil,val[0]] }
|
71
|
+
| words COMMA suffices { result = [val[2],val[0]] }
|
72
|
+
| suffices { result = [val[0],nil] }
|
73
|
+
| suffices COMMA words { result = [val[0],val[2]] }
|
72
74
|
|
73
75
|
u_words : u_word
|
74
76
|
| u_words u_word { result = val.join(' ') }
|
@@ -82,6 +84,11 @@ rule
|
|
82
84
|
|
83
85
|
word : LWORD | UWORD | PWORD
|
84
86
|
|
87
|
+
opt_suffices : /* empty */ | suffices
|
88
|
+
|
89
|
+
suffices : SUFFIX
|
90
|
+
| suffices SUFFIX { result = val.join(' ') }
|
91
|
+
|
85
92
|
---- header
|
86
93
|
require 'singleton'
|
87
94
|
require 'strscan'
|
@@ -98,8 +105,8 @@ require 'strscan'
|
|
98
105
|
:prefer_comma_as_separator => false,
|
99
106
|
:comma => ',',
|
100
107
|
:separator => /\s*(\band\b|\&)\s*/i,
|
101
|
-
:title => /\s*\b(sir|lord|(prof|dr|md|ph\.?d)\.?)(\s+|$)/i,
|
102
|
-
:suffix => /\s*\b(jr|sr|[
|
108
|
+
:title => /\s*\b(sir|lord|count(ess)?|(prof|dr|md|ph\.?d)\.?)(\s+|$)/i,
|
109
|
+
:suffix => /\s*\b(JR|Jr|jr|SR|Sr|sr|[IVX]{2,})(\.|\b)/,
|
103
110
|
:appellation => /\s*\b((mrs?|ms|fr|hr)\.?|miss|herr|frau)(\s+|$)/i
|
104
111
|
}
|
105
112
|
end
|
@@ -151,7 +158,7 @@ require 'strscan'
|
|
151
158
|
end
|
152
159
|
|
153
160
|
def reset
|
154
|
-
@commas, @words, @initials, @yydebug = 0, 0, 0, debug?
|
161
|
+
@commas, @words, @initials, @suffices, @yydebug = 0, 0, 0, 0, debug?
|
155
162
|
self
|
156
163
|
end
|
157
164
|
|
@@ -167,7 +174,7 @@ require 'strscan'
|
|
167
174
|
|
168
175
|
def consume_separator
|
169
176
|
return next_token if seen_separator?
|
170
|
-
@commas, @words, @initials = 0, 0, 0
|
177
|
+
@commas, @words, @initials, @suffices = 0, 0, 0, 0
|
171
178
|
[:AND, :AND]
|
172
179
|
end
|
173
180
|
|
@@ -178,7 +185,14 @@ require 'strscan'
|
|
178
185
|
|
179
186
|
def consume_word(type, word)
|
180
187
|
@words += 1
|
181
|
-
|
188
|
+
|
189
|
+
case type
|
190
|
+
when :UWORD
|
191
|
+
@initials += 1 if word =~ /^\s*[[:alpha:]]\.\s*$/
|
192
|
+
when :SUFFIX
|
193
|
+
@suffices += 1
|
194
|
+
end
|
195
|
+
|
182
196
|
[type, word]
|
183
197
|
end
|
184
198
|
|
@@ -187,12 +201,7 @@ require 'strscan'
|
|
187
201
|
end
|
188
202
|
|
189
203
|
def suffix?
|
190
|
-
|
191
|
-
end
|
192
|
-
|
193
|
-
def seen_suffix?
|
194
|
-
return false unless stack.length > 1
|
195
|
-
last_token == :COMMA || last_token =~ suffix
|
204
|
+
!@suffices.zero? || will_see_suffix?
|
196
205
|
end
|
197
206
|
|
198
207
|
def will_see_suffix?
|
@@ -204,7 +213,8 @@ require 'strscan'
|
|
204
213
|
end
|
205
214
|
|
206
215
|
def seen_full_name?
|
207
|
-
prefer_comma_as_separator? && @words > 1 &&
|
216
|
+
prefer_comma_as_separator? && @words > 1 &&
|
217
|
+
(@initials > 0 || !will_see_initial?) && !will_see_suffix?
|
208
218
|
end
|
209
219
|
|
210
220
|
def next_token
|
@@ -223,6 +233,8 @@ require 'strscan'
|
|
223
233
|
next_token
|
224
234
|
when input.scan(title)
|
225
235
|
consume_word(:TITLE, input.matched.strip)
|
236
|
+
when input.scan(suffix)
|
237
|
+
consume_word(:SUFFIX, input.matched.strip)
|
226
238
|
when input.scan(appellation)
|
227
239
|
[:APPELLATION, input.matched.strip]
|
228
240
|
when input.scan(/((\\\w+)?\{[^\}]*\})*[[:upper:]][^\s#{comma}]*/)
|
@@ -246,4 +258,4 @@ require 'strscan'
|
|
246
258
|
|
247
259
|
attr_reader :input
|
248
260
|
|
249
|
-
# -*- racc -*-
|
261
|
+
# -*- racc -*-
|
data/lib/namae/version.rb
CHANGED
data/namae.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "namae"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.8.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Sylvester Keil", "Dan Collis-Puro"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2013-08-23"
|
13
13
|
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.). "
|
14
14
|
s.email = ["sylvester@keil.or.at", "dan@collispuro.com"]
|
15
15
|
s.extra_rdoc_files = [
|
@@ -49,31 +49,31 @@ Gem::Specification.new do |s|
|
|
49
49
|
s.homepage = "https://github.com/berkmancenter/namae"
|
50
50
|
s.licenses = ["AGPL"]
|
51
51
|
s.require_paths = ["lib"]
|
52
|
-
s.rubygems_version = "
|
52
|
+
s.rubygems_version = "2.0.3"
|
53
53
|
s.summary = "Namae (\u{540d}\u{524d}) parses personal names and splits them into their component parts."
|
54
54
|
|
55
55
|
if s.respond_to? :specification_version then
|
56
|
-
s.specification_version =
|
56
|
+
s.specification_version = 4
|
57
57
|
|
58
58
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
59
59
|
s.add_development_dependency(%q<racc>, ["~> 1.4.8"])
|
60
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.1"])
|
61
60
|
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
62
|
-
s.add_development_dependency(%q<ZenTest>, ["
|
61
|
+
s.add_development_dependency(%q<ZenTest>, [">= 0"])
|
63
62
|
s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
|
63
|
+
s.add_development_dependency(%q<yard>, [">= 0"])
|
64
64
|
else
|
65
65
|
s.add_dependency(%q<racc>, ["~> 1.4.8"])
|
66
|
-
s.add_dependency(%q<bundler>, ["~> 1.1"])
|
67
66
|
s.add_dependency(%q<simplecov>, [">= 0"])
|
68
|
-
s.add_dependency(%q<ZenTest>, ["
|
67
|
+
s.add_dependency(%q<ZenTest>, [">= 0"])
|
69
68
|
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
69
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
70
70
|
end
|
71
71
|
else
|
72
72
|
s.add_dependency(%q<racc>, ["~> 1.4.8"])
|
73
|
-
s.add_dependency(%q<bundler>, ["~> 1.1"])
|
74
73
|
s.add_dependency(%q<simplecov>, [">= 0"])
|
75
|
-
s.add_dependency(%q<ZenTest>, ["
|
74
|
+
s.add_dependency(%q<ZenTest>, [">= 0"])
|
76
75
|
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
76
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
data/spec/namae/parser_spec.rb
CHANGED
@@ -60,6 +60,19 @@ module Namae
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
+
%w{Jr. Jr Sr. Sr II II. VII IX}.each do |suffix|
|
64
|
+
describe "the next token is #{suffix.inspect}" do
|
65
|
+
before { parser.send(:input).string = suffix }
|
66
|
+
it 'returns an SUFFIX token' do
|
67
|
+
parser.send(:next_token).should == [:SUFFIX, suffix]
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'the input matches the suffix pattern' do
|
71
|
+
parser.suffix.should match(suffix)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
63
76
|
end
|
64
77
|
|
65
78
|
describe '#parse!' do
|
@@ -103,9 +116,18 @@ module Namae
|
|
103
116
|
end
|
104
117
|
end
|
105
118
|
|
119
|
+
it 'parses common Jr. as a suffix in sort order' do
|
120
|
+
parser.parse!('Griffey, Jr., Ken')[0].values_at(:given, :family, :suffix).should == ['Ken', 'Griffey', 'Jr.']
|
121
|
+
parser.parse!('Griffey, Ken, Jr.')[0].values_at(:given, :family, :suffix).should == ['Ken', 'Griffey', 'Jr.']
|
122
|
+
end
|
123
|
+
|
124
|
+
it 'parses common Jr. as a suffix in display order' do
|
125
|
+
parser.parse!('Ken Griffey Jr.')[0].values_at(:given, :family, :suffix).should == ['Ken', 'Griffey', 'Jr.']
|
126
|
+
end
|
127
|
+
|
106
128
|
end
|
107
129
|
end
|
108
130
|
|
109
131
|
end
|
110
132
|
end
|
111
|
-
end
|
133
|
+
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: namae
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.8.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Sylvester Keil
|
@@ -10,12 +9,11 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2013-08-23 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: racc
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
18
|
- - ~>
|
21
19
|
- !ruby/object:Gem::Version
|
@@ -23,76 +21,67 @@ dependencies:
|
|
23
21
|
type: :development
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
25
|
- - ~>
|
29
26
|
- !ruby/object:Gem::Version
|
30
27
|
version: 1.4.8
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
|
-
name:
|
29
|
+
name: simplecov
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- -
|
32
|
+
- - '>='
|
37
33
|
- !ruby/object:Gem::Version
|
38
|
-
version: '
|
34
|
+
version: '0'
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- -
|
39
|
+
- - '>='
|
45
40
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
41
|
+
version: '0'
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
43
|
+
name: ZenTest
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
|
-
- -
|
46
|
+
- - '>='
|
53
47
|
- !ruby/object:Gem::Version
|
54
48
|
version: '0'
|
55
49
|
type: :development
|
56
50
|
prerelease: false
|
57
51
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
52
|
requirements:
|
60
|
-
- -
|
53
|
+
- - '>='
|
61
54
|
- !ruby/object:Gem::Version
|
62
55
|
version: '0'
|
63
56
|
- !ruby/object:Gem::Dependency
|
64
|
-
name:
|
57
|
+
name: jeweler
|
65
58
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
59
|
requirements:
|
68
60
|
- - ~>
|
69
61
|
- !ruby/object:Gem::Version
|
70
|
-
version:
|
62
|
+
version: 1.8.3
|
71
63
|
type: :development
|
72
64
|
prerelease: false
|
73
65
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
66
|
requirements:
|
76
67
|
- - ~>
|
77
68
|
- !ruby/object:Gem::Version
|
78
|
-
version:
|
69
|
+
version: 1.8.3
|
79
70
|
- !ruby/object:Gem::Dependency
|
80
|
-
name:
|
71
|
+
name: yard
|
81
72
|
requirement: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
73
|
requirements:
|
84
|
-
- -
|
74
|
+
- - '>='
|
85
75
|
- !ruby/object:Gem::Version
|
86
|
-
version:
|
76
|
+
version: '0'
|
87
77
|
type: :development
|
88
78
|
prerelease: false
|
89
79
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
80
|
requirements:
|
92
|
-
- -
|
81
|
+
- - '>='
|
93
82
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
95
|
-
description:
|
83
|
+
version: '0'
|
84
|
+
description: ' Namae (名前) is a parser for human names. It recognizes personal names
|
96
85
|
of various cultural backgrounds and tries to split them into their component parts
|
97
86
|
(e.g., given and family names, honorifics etc.). '
|
98
87
|
email:
|
@@ -135,29 +124,25 @@ files:
|
|
135
124
|
homepage: https://github.com/berkmancenter/namae
|
136
125
|
licenses:
|
137
126
|
- AGPL
|
127
|
+
metadata: {}
|
138
128
|
post_install_message:
|
139
129
|
rdoc_options: []
|
140
130
|
require_paths:
|
141
131
|
- lib
|
142
132
|
required_ruby_version: !ruby/object:Gem::Requirement
|
143
|
-
none: false
|
144
133
|
requirements:
|
145
|
-
- -
|
134
|
+
- - '>='
|
146
135
|
- !ruby/object:Gem::Version
|
147
136
|
version: '0'
|
148
|
-
segments:
|
149
|
-
- 0
|
150
|
-
hash: -3595872270413772674
|
151
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
|
-
none: false
|
153
138
|
requirements:
|
154
|
-
- -
|
139
|
+
- - '>='
|
155
140
|
- !ruby/object:Gem::Version
|
156
141
|
version: '0'
|
157
142
|
requirements: []
|
158
143
|
rubyforge_project:
|
159
|
-
rubygems_version:
|
144
|
+
rubygems_version: 2.0.3
|
160
145
|
signing_key:
|
161
|
-
specification_version:
|
146
|
+
specification_version: 4
|
162
147
|
summary: Namae (名前) parses personal names and splits them into their component parts.
|
163
148
|
test_files: []
|