name_search 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,421 @@
1
+ aaron erin iron ron ronnie
2
+ abel ab abe eb ebbie
3
+ abiah abijah ab biah
4
+ abiel biel ab
5
+ abraham abram abe
6
+ abner ab
7
+ adam ad ade
8
+ adelbert ad ade albert bert del delbert elbert
9
+ adolph adolphus ad dolph olph
10
+ alabama bama al
11
+ alan al
12
+ alanson alan al lonson
13
+ albert al bert elbert
14
+ aldrich al rich richie
15
+ alexander al alex eleck sandy
16
+ alfred al fred
17
+ alonzo al lon lonas lonzo
18
+ anderson ander andy sonny
19
+ andrew andy drew
20
+ anthony tony tunis
21
+ archibald archie baldo
22
+ arthur art
23
+ asaph asa
24
+ asahel asa
25
+ ashley ash
26
+ azariah aze riah
27
+ augustus augustine august austin gus
28
+ barnabas barney
29
+ bartholomew bart bartel bat mees meus
30
+ basil baz
31
+ benedict ben bennie
32
+ benjamin ben bennie benjy jamie
33
+ bernard barney berney
34
+ birt bird
35
+ bradford brad ford
36
+ broderick ricky brady brody rod
37
+ caleb cal cale calep
38
+ calvin cal vin vinny
39
+ cameron cam ronny ron
40
+ carl charles charlie charley
41
+ casey kasey kc
42
+ cedric ced rick ricky
43
+ charles carl charlie chick chuck
44
+ chauncey chan
45
+ chester chet
46
+ christopher christian chris kit topher
47
+ clarence clair clare
48
+ clement clem
49
+ clifford cliff ford
50
+ clifton cliff tony
51
+ columbus clum
52
+ conrad con conny connie
53
+ cornelius con conny corny niel
54
+ courtney court curt
55
+ cyrenius cene cy renius serene swene
56
+ cyrus cy si
57
+ curtis curt
58
+ dalton dal
59
+ daniel dan danny
60
+ david dave davey day
61
+ dawson dawse doss dos
62
+ delbert bert del
63
+ dennis dennie denny
64
+ dennison dennis dennie denny
65
+ derrick eric rick ricky
66
+ donald don donny
67
+ ebenezer eben eb ebbie
68
+ edmund ed ned ted eddie
69
+ edward ed ned ted teddy eddie
70
+ edwin ed eddie ned win
71
+ elbert albert bert birt bird
72
+ eleazer lazar
73
+ elias eli lee lias
74
+ elijah eli lige
75
+ eliphalet left
76
+ elisha eli lish
77
+ ellswood elswood elsey elze elsie
78
+ elwood woody
79
+ emanuel manny manuel
80
+ enrique quique
81
+ ephraim eph
82
+ epaphroditius dite ditus dyce dyche eppa
83
+ eric rick ricky derrick
84
+ ernest ernie
85
+ eugene gene
86
+ ezekiel ez zeke
87
+ ezra ez ezry ezrie
88
+ ferdinand ferdie
89
+ francis frank fran
90
+ franklin frank fran
91
+ frederick fred freddy fritz
92
+ gabriel gabe gabby
93
+ geoffrey jeffrey geoff jeff
94
+ george washington often
95
+ gerald jerry gerry
96
+ gerardo gera
97
+ gilbert gil bert wilber
98
+ harold hal harry
99
+ henry hal hank harry
100
+ herbert herb bert
101
+ hezekiah hez hy kiah
102
+ hiram hy
103
+ hopkins hop hopp
104
+ horace horry
105
+ hubert hugh bert hub
106
+ ian john
107
+ ignacio nacho
108
+ ignatius iggy nace nate natius
109
+ isaac ike zeke
110
+ isidore izzy
111
+ israel ziggy
112
+ jacob jaap jake jay could be short for jacobus
113
+ james jamie jem jim jimmy
114
+ jebadiah jeb
115
+ jedidiah jed
116
+ jefferson jeff sonny
117
+ jehiel hiel
118
+ jeptha jep nep
119
+ jeremiah jereme jerry
120
+ jesse jess jessie
121
+ jessie jess jesse
122
+ johann john
123
+ john jack jock johnny
124
+ jonathan jon john nathan
125
+ jose pepe
126
+ joseph joe joey jos jody
127
+ joshua josh joe
128
+ josiah joe si
129
+ judson jud sonny
130
+ julias julian jule jules
131
+ junior jr june junie
132
+ kasey casy kc
133
+ kenneth ken kenny
134
+ kingsley king
135
+ kingston king
136
+ lafayette fate laffie
137
+ lamont monty
138
+ lawrence laurence larry lars lon lonny lorne lorry
139
+ lemuel lem
140
+ leonard leo leon len lenny lineau
141
+ leroy lr lee roy
142
+ leslie les
143
+ lester les
144
+ levi lee
145
+ lincoln link
146
+ lorenzo loren
147
+ lucias lucas luke
148
+ luis luie
149
+ luther luke
150
+ lyndon lynn lindy
151
+ malachi mal
152
+ malcolm mal
153
+ marcus mark
154
+ martin marty
155
+ marvin marv
156
+ matthew matthias matt thias thys
157
+ maurice morris morey
158
+ mervin merv
159
+ michael ike mike micah mick mickey
160
+ mitchell mickey mitch
161
+ montgomery monty gum
162
+ napoleon nap nappy leon
163
+ nathan nate
164
+ nathaniel nathan nate nat natty than
165
+ newton newt
166
+ nicholas nick nickie claas claes
167
+ norbert bert norby
168
+ obediah diah dyer obed obie
169
+ oliver ollie obbie obby
170
+ orange ora
171
+ oswald ossy ozzy waldo
172
+ patrick paddy pat patsy pate
173
+ pelegrine perry
174
+ percival percy
175
+ peter pete pate perry
176
+ philetus leet phil
177
+ phillip phil
178
+ piper pi pie
179
+ prescott scott scotty pres
180
+ randal randy
181
+ randle randy
182
+ randolph randy dolph
183
+ raymond ray
184
+ reginald reg reggie naldo renny
185
+ reuben rube
186
+ richard dick dickon rich rick ricky
187
+ robert bob dob dobbin hob hobkin rob robby bobby robin rupert
188
+ roger rodger roge hodge rod
189
+ roland lanny rollo rolly
190
+ ronald ron ronnie naldo
191
+ rudolph rudolphus dolph olph rolf rudy
192
+ russell russ rusty
193
+ samuel sam sammy
194
+ sebastian seb
195
+ seymour morey see
196
+ shelton shelly shel tony
197
+ sheridan dan danny sher
198
+ sidney sid syd
199
+ silas si
200
+ simon simeon si sion
201
+ smith smitty
202
+ solomon sal salmon saul sol solly zolly
203
+ stephen steven steve steph
204
+ sullivan sully van
205
+ sylvester si sly sy syl vester vet vessie
206
+ terence terry
207
+ thaddeus thad
208
+ theodore ted teddy theo
209
+ theophilus theo
210
+ thomas tom thom tommy tuck tucker
211
+ timothy tim timmy
212
+ tobias toby bias
213
+ uriah riah
214
+ valentine felty feltie
215
+ vincent vinson vince vin vinnie
216
+ wallace wally
217
+ washington wash
218
+ wilber wilbur will willie
219
+ wilfred will willie fred
220
+ william will willie bill billy
221
+ winfield win winny field
222
+ woodrow wood woody drew
223
+ zachariah zach zachy zeke
224
+ zachary zach zachy zeke
225
+ zebedee zeb
226
+ zedediah zed diah dyer
227
+ zephaniah zeph
228
+
229
+ abigail abby abbie nabby gail
230
+ adaline adeline ada addy dell delia lena
231
+ adelaide addy adele dell della heidi
232
+ adelphia adele addy dell delphia philly
233
+ agatha aggy
234
+ agnes aggy inez nessa
235
+ aileen allie lena
236
+ alabama bama
237
+ alberta allie bert bertie
238
+ alexandra alex alla sandy
239
+ alfreda alfy freda freddy frieda
240
+ alice alicia allie elsie lisa
241
+ allison al ali ally
242
+ almeda mary
243
+ almena allie mena
244
+ amanda manda mandy
245
+ amelia emily mel millie amy
246
+ ann anne agnes annie nan nanny nana nancy (and
247
+ annaka ann anne annie nancy niki
248
+ antoinette antonia ann tony netta
249
+ arabella arabelle ara arry belle bella
250
+ arlene arly lena
251
+ armena arry mena
252
+ asenath assene natty sene
253
+ ashley ash
254
+ asmine amy
255
+ augusta augustina aggy gatsy gussie tina
256
+ azubah zubia
257
+ barbara bab babs barby bobbie
258
+ beatrice bea trisha trix trixie
259
+ belinda belle linda
260
+ bernadette bunny
261
+ bertha birdie bert bertie
262
+ bridget biddie biddy bridgie bridie
263
+ camille cammie millie
264
+ catriona catherine
265
+ cornelia cornie nelia
266
+ carol caroline carolyn carrie cassie lynn
267
+ cassandra cassie sandra sandy
268
+ catherine cathleen katherine kathleen cathy kathy katy cassie cat kay kit kittie trina lena
269
+ cecilia celia cissy sissie
270
+ charlotte char lottie lotta sherry
271
+ christine christina christiana kristine chris kris crissy christy kristy tina
272
+ cinderella cindy
273
+ clarinda clara
274
+ clarissa clara cissy
275
+ claudia claud caya
276
+ constance connie
277
+ cordelia cordy delia
278
+ cornelia corny nelle nelly nelia
279
+ cynthia cindy cintha
280
+ darlene lena dara darry
281
+ deborah debora debby debbie deb
282
+ deliverance della delly dilly
283
+ delores dell lola lolly della dee
284
+ dianne di ann
285
+ dicey dicie
286
+ dorothy dora dot dottie
287
+ dorcus darkey darcus
288
+ dorothy dolly dot dortha dotty
289
+ edith edie
290
+ eldora dora
291
+ eleanor elaine ellen ellie lanna lenora nelly nora
292
+ elise ish
293
+ elizabeth eliza bess bessie beth betsy betty lib libby liza lisa liz lizzie
294
+ elmira elly ellie mira
295
+ elouise louise
296
+ elvira evie
297
+ emeline emma emily emmy millie em
298
+ emily emmy millie emma em
299
+ estelle estella essy essie stella
300
+ esther essie essy
301
+ evaline eva eve lena
302
+ faith fay
303
+ fidelia delia
304
+ florence flo flora flossy
305
+ frances fanny fran cissy frankie sis
306
+ fredericka freda freddy ricka frieda
307
+ gabrielle gabriella gabby ella
308
+ genevieve eve jean jenny
309
+ geraldine dina gerry gerrie jerry
310
+ gertrude trudy gert gertie
311
+ grizzel grace
312
+ gwendolyn gwen wendy
313
+ hannah nan nanny anna
314
+ harriet hattie
315
+ helen helene ella ellen ellie lena
316
+ heloise eloise lois
317
+ henrietta etta etty hank henny henri nettie retta yetta
318
+ hermione hermie
319
+ hepsibah hephsibah hipsie
320
+ hester hessy esther hetty
321
+ irene rena
322
+ isabel isabelle isabella bella belle eba ebba elba ib ibbee issy nib nibby tibbie
323
+ isadora dora issy
324
+ jane janie jean jennie jessie
325
+ janet jessie jan jane
326
+ jean jeanne jane jeannie
327
+ jeanette janet jean jessie nettie
328
+ jemima mima
329
+ jennifer jennie
330
+ jessica jessie jess
331
+ joan nonie nona
332
+ joanna johannah joan jody hannah jo
333
+ josephine jody jo joey josey fina
334
+ joyce joy
335
+ juanita nettie nita
336
+ judith - judy
337
+ julia julie jill
338
+ kassandra kassie
339
+ keziah kizza kizzie
340
+ lavina lavinia ina vina viney
341
+ lenora nora lee
342
+ leslie lizzy les
343
+ letitia lettie lettice titia tish tisha
344
+ lillah lily lilly lil lolly
345
+ lillian lil lilly lolly
346
+ linda lindy lynn melinda philinda
347
+ loretta etta lorrie retta lottie
348
+ lorraine lorrie
349
+ louise louisa lou eliza lois
350
+ lucille lu lou cille lucy
351
+ lucinda cindy lu lou lucy
352
+ lucretia creasy lucy
353
+ luella ella lu lula
354
+ lydia lidia lyddy
355
+ madeline lena maddy madge magda maggie maida maud
356
+ magdelina lena madge magda maggie
357
+ mahala hallie mahaley
358
+ margaret margaretta daisy gretta madge maggie margery marge margie margo meg midge peg peggy rita
359
+ martha marty mat mattie patsy patty
360
+ mary molly polly mae mamie mitzi sukey
361
+ matilda tilly matty maud
362
+ mehitabel hetty hitty mabel mitty
363
+ melinda linda lindy mel mindy
364
+ melissa lisa lissa lyssa mel milly missy wessa
365
+ melvina mellie melly mel
366
+ michelle chelle mica micha miche mickey shelly
367
+ mildred milly
368
+ millicent milly missy
369
+ minerva minnie
370
+ miranda mandy mira randy
371
+ miriam mimi mitzi
372
+ monique monike mon
373
+ morag merran marion sarah sally
374
+ nancy nan nannie
375
+ natalie natty nettie tally
376
+ olive olivia ollie nollie livia libby
377
+ parmelia amelia melia milly
378
+ parthena thena
379
+ patience pat patty
380
+ patricia pat patty patsy tricia
381
+ paula paulina polly lina
382
+ penelope penny
383
+ philinda linda
384
+ priscilla cissy cilla prissy
385
+ prudence prudy prue puss
386
+ rachel shelly
387
+ rebecca reba becca becky beck
388
+ regina reggie gina
389
+ relief leafa
390
+ roberta bobbie robbie bert bertie or birdie
391
+ rosabel rosabella belle rosa rose roz
392
+ rosalyn rosalinda rosa rose linda roz
393
+ roseann roseanna rose ann roz rosie
394
+ roxanne roxanna ann rose roxie
395
+ sabrina brina
396
+ sandra sandy
397
+ serena reni
398
+ shannon shanie
399
+ sophronia sophie sophia
400
+ sarah sally sadie
401
+ sarah jane alydane dane
402
+ selina celina lena
403
+ serena rena
404
+ shirley lee sherry shirl
405
+ sholette lottie
406
+ sine jean jane
407
+ submit mitty
408
+ susan susannah sue sukey susie suz hannah
409
+ tabitha tabby
410
+ temperence tempy
411
+ tennessee tennie tenny
412
+ theresa teresa res terry tess tessie tessa thirza thursa tia tracy
413
+ tryphena phena
414
+ valerie val
415
+ vanessa nessa essa vanna
416
+ veronica franky frony ron ronnie ronna vonnie
417
+ victoria vicky tori tory
418
+ virginia ginger ginny jane jennie virgy virgie
419
+ wilimena mina willie wilma minnie
420
+ wilhelmina mina willie wilma minnie wilha
421
+ winifred winnie freddie winnet
@@ -7,11 +7,44 @@ module NameSearch
7
7
 
8
8
  def self.create_family(*nick_names)
9
9
  family = NickNameFamily.create
10
- scrubbed_names = nick_names.map{|x| Name.scrub_and_split_name(x)}.flatten
10
+ scrubbed_names = nick_names.flatten.map{|x| Name.scrub_and_split_name(x)}.flatten
11
11
  scrubbed_names.each do |name|
12
12
  family.names << Name.find_or_create_by_value(name)
13
13
  end
14
14
  family
15
15
  end
16
+
17
+ def self.update_families_from_file(file_name)
18
+ File.open(file_name).each_line{|line| process_file_line(line)}
19
+ end
20
+
21
+ private
22
+
23
+ def self.process_file_line(line)
24
+ scrubbed_name_values = line.split.map{|x| Name.scrub_and_split_name(x)}.flatten
25
+ names = Name.where(:value => scrubbed_name_values).all
26
+ first_name = names.find{|x| x.value == scrubbed_name_values.first}
27
+
28
+ if should_create_new_family?(first_name, names)
29
+ family = NickNameFamily.create
30
+ scrubbed_name_values.each do |name|
31
+ family.names << Name.find_or_create_by_value(name)
32
+ end
33
+ else
34
+ scrubbed_name_values.from(1).each do |name|
35
+ first_name.nick_name_families.first.names << Name.find_or_create_by_value(name)
36
+ end
37
+ end
38
+ end
39
+
40
+ def self.should_create_new_family?(first_name, names)
41
+ first_name.nil? ||
42
+ first_name.nick_name_families.length == 0 ||
43
+ other_families(first_name, names).length > 0
44
+ end
45
+
46
+ def self.other_families(first_name, names)
47
+ names.map(&:nick_name_family_ids).flatten.uniq - first_name.nick_name_family_ids
48
+ end
16
49
  end
17
50
  end
@@ -15,4 +15,10 @@ namespace :name_search do
15
15
  end
16
16
  puts 'finished'
17
17
  end
18
+
19
+ desc 'adds the 1990 census nick names to the database (http://www.censusdiggins.com/nicknames.htm)'
20
+ task :add_census_nick_names => :environment do
21
+ census_file = File.expand_path('../../../assets/census_nick_names.txt', __FILE__)
22
+ NameSearch::NickNameFamily.update_families_from_file(census_file)
23
+ end
18
24
  end
@@ -1,3 +1,3 @@
1
1
  module NameSearch
2
- VERSION = '0.8.1'
2
+ VERSION = '0.9.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: name_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-07-23 00:00:00.000000000 -05:00
13
- default_executable:
12
+ date: 2011-10-06 00:00:00.000000000Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rails
17
- requirement: &11540780 !ruby/object:Gem::Requirement
16
+ requirement: &70250461092460 !ruby/object:Gem::Requirement
18
17
  none: false
19
18
  requirements:
20
19
  - - ! '>='
@@ -22,7 +21,7 @@ dependencies:
22
21
  version: 3.0.0
23
22
  type: :runtime
24
23
  prerelease: false
25
- version_requirements: *11540780
24
+ version_requirements: *70250461092460
26
25
  description: Search for people's names while taking into consideration nick names
27
26
  and word ordering.
28
27
  email:
@@ -31,26 +30,26 @@ executables: []
31
30
  extensions: []
32
31
  extra_rdoc_files: []
33
32
  files:
34
- - lib/name_search.rb
33
+ - lib/assets/census_nick_names.txt
35
34
  - lib/generators/name_search/migration/migration_generator.rb
36
35
  - lib/generators/name_search/migration/templates/migration.rb
37
36
  - lib/name_search/active_relation_search.rb
38
- - lib/name_search/railties/tasks.rake
39
- - lib/name_search/name_search_on.rb
40
- - lib/name_search/models/searchable.rb
41
37
  - lib/name_search/models/name.rb
42
38
  - lib/name_search/models/nick_name_family.rb
43
39
  - lib/name_search/models/nick_name_family_join.rb
44
- - lib/name_search/search.rb
40
+ - lib/name_search/models/searchable.rb
41
+ - lib/name_search/name_search_on.rb
42
+ - lib/name_search/name_searchables_concerns.rb
45
43
  - lib/name_search/railtie.rb
46
- - lib/name_search/version.rb
44
+ - lib/name_search/railties/tasks.rake
45
+ - lib/name_search/search.rb
47
46
  - lib/name_search/search_result.rb
48
- - lib/name_search/name_searchables_concerns.rb
47
+ - lib/name_search/version.rb
48
+ - lib/name_search.rb
49
49
  - MIT-LICENSE
50
50
  - Rakefile
51
51
  - Gemfile
52
52
  - README.rdoc
53
- has_rdoc: true
54
53
  homepage: https://github.com/paulyoder/name_search
55
54
  licenses: []
56
55
  post_install_message:
@@ -71,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
70
  version: '0'
72
71
  requirements: []
73
72
  rubyforge_project:
74
- rubygems_version: 1.6.2
73
+ rubygems_version: 1.8.6
75
74
  signing_key:
76
75
  specification_version: 3
77
76
  summary: Search for people's names while taking into consideration nick names and