-
Notifications
You must be signed in to change notification settings - Fork 104
/
tests.py
2626 lines (2243 loc) · 91.9 KB
/
tests.py
1
2
3
4
5
6
7
8
9
10
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
"""
Run this file to run the tests.
``python tests.py``
Or install nose and run nosetests.
``pip install nose``
then:
``nosetests``
Post a ticket and/or clone and fix it. Pull requests with tests gladly accepted.
https://github.com/derek73/python-nameparser/issues
https://github.com/derek73/python-nameparser/pulls
"""
import logging
import re
try:
import dill
except ImportError:
dill = False
from nameparser import HumanName
from nameparser.util import u
from nameparser.config import Constants, TupleManager
log = logging.getLogger('HumanName')
try:
unittest.expectedFailure
except AttributeError:
# Python 2.6 backport
import unittest2 as unittest
class HumanNameTestBase(unittest.TestCase):
def m(self, actual, expected, hn):
"""assertEqual with a better message and awareness of hn.C.empty_attribute_default"""
expected = expected or hn.C.empty_attribute_default
try:
self.assertEqual(actual, expected, "'%s' != '%s' for '%s'\n%r" % (
actual,
expected,
hn.original,
hn
))
except UnicodeDecodeError:
self.assertEqual(actual, expected)
class HumanNamePythonTests(HumanNameTestBase):
def test_utf8(self):
hn = HumanName("de la Véña, Jüan")
self.m(hn.first, "Jüan", hn)
self.m(hn.last, "de la Véña", hn)
def test_string_output(self):
hn = HumanName("de la Véña, Jüan")
def test_escaped_utf8_bytes(self):
hn = HumanName(b'B\xc3\xb6ck, Gerald')
self.m(hn.first, "Gerald", hn)
self.m(hn.last, "Böck", hn)
def test_len(self):
hn = HumanName("Doe-Ray, Dr. John P., CLU, CFP, LUTC")
self.m(len(hn), 5, hn)
hn = HumanName("John Doe")
self.m(len(hn), 2, hn)
@unittest.skipUnless(dill, "requires python-dill module to test pickling")
def test_config_pickle(self):
constants = Constants()
self.assertTrue(dill.pickles(constants))
@unittest.skipUnless(dill, "requires python-dill module to test pickling")
def test_name_instance_pickle(self):
hn = HumanName("Title First Middle Middle Last, Jr.")
self.assertTrue(dill.pickles(hn))
def test_comparison(self):
hn1 = HumanName("Doe-Ray, Dr. John P., CLU, CFP, LUTC")
hn2 = HumanName("Dr. John P. Doe-Ray, CLU, CFP, LUTC")
self.assertTrue(hn1 == hn2)
self.assertTrue(hn1 is not hn2)
self.assertTrue(hn1 == "Dr. John P. Doe-Ray CLU, CFP, LUTC")
hn1 = HumanName("Doe, Dr. John P., CLU, CFP, LUTC")
hn2 = HumanName("Dr. John P. Doe-Ray, CLU, CFP, LUTC")
self.assertTrue(not hn1 == hn2)
self.assertTrue(not hn1 == 0)
self.assertTrue(not hn1 == "test")
self.assertTrue(not hn1 == ["test"])
self.assertTrue(not hn1 == {"test": hn2})
def test_assignment_to_full_name(self):
hn = HumanName("John A. Kenneth Doe, Jr.")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A. Kenneth", hn)
self.m(hn.suffix, "Jr.", hn)
hn.full_name = "Juan Velasquez y Garcia III"
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "III", hn)
def test_get_full_name_attribute_references_internal_lists(self):
hn = HumanName("John Williams")
hn.first_list = ["Larry"]
self.m(hn.full_name, "Larry Williams", hn)
def test_assignment_to_attribute(self):
hn = HumanName("John A. Kenneth Doe, Jr.")
hn.last = "de la Vega"
self.m(hn.last, "de la Vega", hn)
hn.title = "test"
self.m(hn.title, "test", hn)
hn.first = "test"
self.m(hn.first, "test", hn)
hn.middle = "test"
self.m(hn.middle, "test", hn)
hn.suffix = "test"
self.m(hn.suffix, "test", hn)
with self.assertRaises(TypeError):
hn.suffix = [['test']]
with self.assertRaises(TypeError):
hn.suffix = {"test": "test"}
def test_assign_list_to_attribute(self):
hn = HumanName("John A. Kenneth Doe, Jr.")
hn.title = ["test1", "test2"]
self.m(hn.title, "test1 test2", hn)
hn.first = ["test3", "test4"]
self.m(hn.first, "test3 test4", hn)
hn.middle = ["test5", "test6", "test7"]
self.m(hn.middle, "test5 test6 test7", hn)
hn.last = ["test8", "test9", "test10"]
self.m(hn.last, "test8 test9 test10", hn)
hn.suffix = ['test']
self.m(hn.suffix, "test", hn)
def test_comparison_case_insensitive(self):
hn1 = HumanName("Doe-Ray, Dr. John P., CLU, CFP, LUTC")
hn2 = HumanName("dr. john p. doe-Ray, CLU, CFP, LUTC")
self.assertTrue(hn1 == hn2)
self.assertTrue(hn1 is not hn2)
self.assertTrue(hn1 == "Dr. John P. Doe-ray clu, CFP, LUTC")
def test_slice(self):
hn = HumanName("Doe-Ray, Dr. John P., CLU, CFP, LUTC")
self.m(list(hn), ['Dr.', 'John', 'P.', 'Doe-Ray', 'CLU, CFP, LUTC'], hn)
self.m(hn[1:], ['John', 'P.', 'Doe-Ray', 'CLU, CFP, LUTC', hn.C.empty_attribute_default], hn)
self.m(hn[1:-2], ['John', 'P.', 'Doe-Ray'], hn)
def test_getitem(self):
hn = HumanName("Dr. John A. Kenneth Doe, Jr.")
self.m(hn['title'], "Dr.", hn)
self.m(hn['first'], "John", hn)
self.m(hn['last'], "Doe", hn)
self.m(hn['middle'], "A. Kenneth", hn)
self.m(hn['suffix'], "Jr.", hn)
def test_setitem(self):
hn = HumanName("Dr. John A. Kenneth Doe, Jr.")
hn['title'] = 'test'
self.m(hn['title'], "test", hn)
hn['last'] = ['test', 'test2']
self.m(hn['last'], "test test2", hn)
with self.assertRaises(TypeError):
hn["suffix"] = [['test']]
with self.assertRaises(TypeError):
hn["suffix"] = {"test": "test"}
def test_conjunction_names(self):
hn = HumanName("johnny y")
self.m(hn.first, "johnny", hn)
self.m(hn.last, "y", hn)
def test_prefix_names(self):
hn = HumanName("vai la")
self.m(hn.first, "vai", hn)
self.m(hn.last, "la", hn)
def test_blank_name(self):
hn = HumanName()
self.m(hn.first, "", hn)
self.m(hn.last, "", hn)
def test_surnames_list_attribute(self):
hn = HumanName("John Edgar Casey Williams III")
self.m(hn.surnames_list, ["Edgar", "Casey", "Williams"], hn)
def test_surnames_attribute(self):
hn = HumanName("John Edgar Casey Williams III")
self.m(hn.surnames, "Edgar Casey Williams", hn)
def test_is_prefix_with_list(self):
hn = HumanName()
items = ['firstname', 'lastname', 'del']
self.assertTrue(hn.is_prefix(items))
self.assertTrue(hn.is_prefix(items[1:]))
def test_is_conjunction_with_list(self):
hn = HumanName()
items = ['firstname', 'lastname', 'and']
self.assertTrue(hn.is_conjunction(items))
self.assertTrue(hn.is_conjunction(items[1:]))
def test_override_constants(self):
C = Constants()
hn = HumanName(constants=C)
self.assertTrue(hn.C is C)
def test_override_regex(self):
var = TupleManager([("spaces", re.compile(r"\s+", re.U)),])
C = Constants(regexes=var)
hn = HumanName(constants=C)
self.assertTrue(hn.C.regexes == var)
def test_override_titles(self):
var = ["abc","def"]
C = Constants(titles=var)
hn = HumanName(constants=C)
self.assertTrue(sorted(hn.C.titles) == sorted(var))
def test_override_first_name_titles(self):
var = ["abc","def"]
C = Constants(first_name_titles=var)
hn = HumanName(constants=C)
self.assertTrue(sorted(hn.C.first_name_titles) == sorted(var))
def test_override_prefixes(self):
var = ["abc","def"]
C = Constants(prefixes=var)
hn = HumanName(constants=C)
self.assertTrue(sorted(hn.C.prefixes) == sorted(var))
def test_override_suffix_acronyms(self):
var = ["abc","def"]
C = Constants(suffix_acronyms=var)
hn = HumanName(constants=C)
self.assertTrue(sorted(hn.C.suffix_acronyms) == sorted(var))
def test_override_suffix_not_acronyms(self):
var = ["abc","def"]
C = Constants(suffix_not_acronyms=var)
hn = HumanName(constants=C)
self.assertTrue(sorted(hn.C.suffix_not_acronyms) == sorted(var))
def test_override_conjunctions(self):
var = ["abc","def"]
C = Constants(conjunctions=var)
hn = HumanName(constants=C)
self.assertTrue(sorted(hn.C.conjunctions) == sorted(var))
def test_override_capitalization_exceptions(self):
var = TupleManager([("spaces", re.compile(r"\s+", re.U)),])
C = Constants(capitalization_exceptions=var)
hn = HumanName(constants=C)
self.assertTrue(hn.C.capitalization_exceptions == var)
class FirstNameHandlingTests(HumanNameTestBase):
def test_first_name(self):
hn = HumanName("Andrew")
self.m(hn.first, "Andrew", hn)
def test_assume_title_and_one_other_name_is_last_name(self):
hn = HumanName("Rev Andrews")
self.m(hn.title, "Rev", hn)
self.m(hn.last, "Andrews", hn)
# TODO: Seems "Andrews, M.D.", Andrews should be treated as a last name
# but other suffixes like "George Jr." should be first names. Might be
# related to https://github.com/derek73/python-nameparser/issues/2
@unittest.expectedFailure
def test_assume_suffix_title_and_one_other_name_is_last_name(self):
hn = HumanName("Andrews, M.D.")
self.m(hn.suffix, "M.D.", hn)
self.m(hn.last, "Andrews", hn)
def test_suffix_in_lastname_part_of_lastname_comma_format(self):
hn = HumanName("Smith Jr., John")
self.m(hn.last, "Smith", hn)
self.m(hn.first, "John", hn)
self.m(hn.suffix, "Jr.", hn)
def test_sir_exception_to_first_name_rule(self):
hn = HumanName("Sir Gerald")
self.m(hn.title, "Sir", hn)
self.m(hn.first, "Gerald", hn)
def test_king_exception_to_first_name_rule(self):
hn = HumanName("King Henry")
self.m(hn.title, "King", hn)
self.m(hn.first, "Henry", hn)
def test_queen_exception_to_first_name_rule(self):
hn = HumanName("Queen Elizabeth")
self.m(hn.title, "Queen", hn)
self.m(hn.first, "Elizabeth", hn)
def test_dame_exception_to_first_name_rule(self):
hn = HumanName("Dame Mary")
self.m(hn.title, "Dame", hn)
self.m(hn.first, "Mary", hn)
def test_first_name_is_not_prefix_if_only_two_parts(self):
"""When there are only two parts, don't join prefixes or conjunctions"""
hn = HumanName("Van Nguyen")
self.m(hn.first, "Van", hn)
self.m(hn.last, "Nguyen", hn)
def test_first_name_is_not_prefix_if_only_two_parts_comma(self):
hn = HumanName("Nguyen, Van")
self.m(hn.first, "Van", hn)
self.m(hn.last, "Nguyen", hn)
@unittest.expectedFailure
def test_first_name_is_prefix_if_three_parts(self):
"""Not sure how to fix this without breaking Mr and Mrs"""
hn = HumanName("Mr. Van Nguyen")
self.m(hn.first, "Van", hn)
self.m(hn.last, "Nguyen", hn)
class HumanNameBruteForceTests(HumanNameTestBase):
def test1(self):
hn = HumanName("John Doe")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
def test2(self):
hn = HumanName("John Doe, Jr.")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.suffix, "Jr.", hn)
def test3(self):
hn = HumanName("John Doe III")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.suffix, "III", hn)
def test4(self):
hn = HumanName("Doe, John")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
def test5(self):
hn = HumanName("Doe, John, Jr.")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.suffix, "Jr.", hn)
def test6(self):
hn = HumanName("Doe, John III")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.suffix, "III", hn)
def test7(self):
hn = HumanName("John A. Doe")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A.", hn)
def test8(self):
hn = HumanName("John A. Doe, Jr")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A.", hn)
self.m(hn.suffix, "Jr", hn)
def test9(self):
hn = HumanName("John A. Doe III")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A.", hn)
self.m(hn.suffix, "III", hn)
def test10(self):
hn = HumanName("Doe, John A.")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A.", hn)
def test11(self):
hn = HumanName("Doe, John A., Jr.")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A.", hn)
self.m(hn.suffix, "Jr.", hn)
def test12(self):
hn = HumanName("Doe, John A., III")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A.", hn)
self.m(hn.suffix, "III", hn)
def test13(self):
hn = HumanName("John A. Kenneth Doe")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A. Kenneth", hn)
def test14(self):
hn = HumanName("John A. Kenneth Doe, Jr.")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A. Kenneth", hn)
self.m(hn.suffix, "Jr.", hn)
def test15(self):
hn = HumanName("John A. Kenneth Doe III")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A. Kenneth", hn)
self.m(hn.suffix, "III", hn)
def test16(self):
hn = HumanName("Doe, John. A. Kenneth")
self.m(hn.first, "John.", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A. Kenneth", hn)
def test17(self):
hn = HumanName("Doe, John. A. Kenneth, Jr.")
self.m(hn.first, "John.", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A. Kenneth", hn)
self.m(hn.suffix, "Jr.", hn)
def test18(self):
hn = HumanName("Doe, John. A. Kenneth III")
self.m(hn.first, "John.", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A. Kenneth", hn)
self.m(hn.suffix, "III", hn)
def test19(self):
hn = HumanName("Dr. John Doe")
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.title, "Dr.", hn)
def test20(self):
hn = HumanName("Dr. John Doe, Jr.")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.suffix, "Jr.", hn)
def test21(self):
hn = HumanName("Dr. John Doe III")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.suffix, "III", hn)
def test22(self):
hn = HumanName("Doe, Dr. John")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
def test23(self):
hn = HumanName("Doe, Dr. John, Jr.")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.suffix, "Jr.", hn)
def test24(self):
hn = HumanName("Doe, Dr. John III")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.suffix, "III", hn)
def test25(self):
hn = HumanName("Dr. John A. Doe")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A.", hn)
def test26(self):
hn = HumanName("Dr. John A. Doe, Jr.")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A.", hn)
self.m(hn.suffix, "Jr.", hn)
def test27(self):
hn = HumanName("Dr. John A. Doe III")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A.", hn)
self.m(hn.suffix, "III", hn)
def test28(self):
hn = HumanName("Doe, Dr. John A.")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A.", hn)
def test29(self):
hn = HumanName("Doe, Dr. John A. Jr.")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.middle, "A.", hn)
self.m(hn.suffix, "Jr.", hn)
def test30(self):
hn = HumanName("Doe, Dr. John A. III")
self.m(hn.title, "Dr.", hn)
self.m(hn.middle, "A.", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.suffix, "III", hn)
def test31(self):
hn = HumanName("Dr. John A. Kenneth Doe")
self.m(hn.title, "Dr.", hn)
self.m(hn.middle, "A. Kenneth", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
def test32(self):
hn = HumanName("Dr. John A. Kenneth Doe, Jr.")
self.m(hn.title, "Dr.", hn)
self.m(hn.middle, "A. Kenneth", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.suffix, "Jr.", hn)
def test33(self):
hn = HumanName("Al Arnold Gore, Jr.")
self.m(hn.middle, "Arnold", hn)
self.m(hn.first, "Al", hn)
self.m(hn.last, "Gore", hn)
self.m(hn.suffix, "Jr.", hn)
def test34(self):
hn = HumanName("Dr. John A. Kenneth Doe III")
self.m(hn.title, "Dr.", hn)
self.m(hn.middle, "A. Kenneth", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.suffix, "III", hn)
def test35(self):
hn = HumanName("Doe, Dr. John A. Kenneth")
self.m(hn.title, "Dr.", hn)
self.m(hn.middle, "A. Kenneth", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
def test36(self):
hn = HumanName("Doe, Dr. John A. Kenneth Jr.")
self.m(hn.title, "Dr.", hn)
self.m(hn.middle, "A. Kenneth", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.suffix, "Jr.", hn)
def test37(self):
hn = HumanName("Doe, Dr. John A. Kenneth III")
self.m(hn.title, "Dr.", hn)
self.m(hn.middle, "A. Kenneth", hn)
self.m(hn.first, "John", hn)
self.m(hn.last, "Doe", hn)
self.m(hn.suffix, "III", hn)
def test38(self):
hn = HumanName("Juan de la Vega")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
def test39(self):
hn = HumanName("Juan de la Vega, Jr.")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.suffix, "Jr.", hn)
def test40(self):
hn = HumanName("Juan de la Vega III")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.suffix, "III", hn)
def test41(self):
hn = HumanName("de la Vega, Juan")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
def test42(self):
hn = HumanName("de la Vega, Juan, Jr.")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.suffix, "Jr.", hn)
def test43(self):
hn = HumanName("de la Vega, Juan III")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.suffix, "III", hn)
def test44(self):
hn = HumanName("Juan Velasquez y Garcia")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
def test45(self):
hn = HumanName("Juan Velasquez y Garcia, Jr.")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "Jr.", hn)
def test46(self):
hn = HumanName("Juan Velasquez y Garcia III")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "III", hn)
def test47(self):
hn = HumanName("Velasquez y Garcia, Juan")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
def test48(self):
hn = HumanName("Velasquez y Garcia, Juan, Jr.")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "Jr.", hn)
def test49(self):
hn = HumanName("Velasquez y Garcia, Juan III")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "III", hn)
def test50(self):
hn = HumanName("Dr. Juan de la Vega")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
def test51(self):
hn = HumanName("Dr. Juan de la Vega, Jr.")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.suffix, "Jr.", hn)
def test52(self):
hn = HumanName("Dr. Juan de la Vega III")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.suffix, "III", hn)
def test53(self):
hn = HumanName("de la Vega, Dr. Juan")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
def test54(self):
hn = HumanName("de la Vega, Dr. Juan, Jr.")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.suffix, "Jr.", hn)
def test55(self):
hn = HumanName("de la Vega, Dr. Juan III")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.suffix, "III", hn)
def test56(self):
hn = HumanName("Dr. Juan Velasquez y Garcia")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
def test57(self):
hn = HumanName("Dr. Juan Velasquez y Garcia, Jr.")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "Jr.", hn)
def test58(self):
hn = HumanName("Dr. Juan Velasquez y Garcia III")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "III", hn)
def test59(self):
hn = HumanName("Velasquez y Garcia, Dr. Juan")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
def test60(self):
hn = HumanName("Velasquez y Garcia, Dr. Juan, Jr.")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "Jr.", hn)
def test61(self):
hn = HumanName("Velasquez y Garcia, Dr. Juan III")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "III", hn)
def test62(self):
hn = HumanName("Juan Q. de la Vega")
self.m(hn.first, "Juan", hn)
self.m(hn.middle, "Q.", hn)
self.m(hn.last, "de la Vega", hn)
def test63(self):
hn = HumanName("Juan Q. de la Vega, Jr.")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.middle, "Q.", hn)
self.m(hn.suffix, "Jr.", hn)
def test64(self):
hn = HumanName("Juan Q. de la Vega III")
self.m(hn.first, "Juan", hn)
self.m(hn.middle, "Q.", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.suffix, "III", hn)
def test65(self):
hn = HumanName("de la Vega, Juan Q.")
self.m(hn.first, "Juan", hn)
self.m(hn.middle, "Q.", hn)
self.m(hn.last, "de la Vega", hn)
def test66(self):
hn = HumanName("de la Vega, Juan Q., Jr.")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.middle, "Q.", hn)
self.m(hn.suffix, "Jr.", hn)
def test67(self):
hn = HumanName("de la Vega, Juan Q. III")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.middle, "Q.", hn)
self.m(hn.suffix, "III", hn)
def test68(self):
hn = HumanName("Juan Q. Velasquez y Garcia")
self.m(hn.middle, "Q.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
def test69(self):
hn = HumanName("Juan Q. Velasquez y Garcia, Jr.")
self.m(hn.middle, "Q.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "Jr.", hn)
def test70(self):
hn = HumanName("Juan Q. Velasquez y Garcia III")
self.m(hn.middle, "Q.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "III", hn)
def test71(self):
hn = HumanName("Velasquez y Garcia, Juan Q.")
self.m(hn.middle, "Q.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
def test72(self):
hn = HumanName("Velasquez y Garcia, Juan Q., Jr.")
self.m(hn.middle, "Q.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "Jr.", hn)
def test73(self):
hn = HumanName("Velasquez y Garcia, Juan Q. III")
self.m(hn.middle, "Q.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "III", hn)
def test74(self):
hn = HumanName("Dr. Juan Q. de la Vega")
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.middle, "Q.", hn)
self.m(hn.last, "de la Vega", hn)
def test75(self):
hn = HumanName("Dr. Juan Q. de la Vega, Jr.")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.middle, "Q.", hn)
self.m(hn.title, "Dr.", hn)
self.m(hn.suffix, "Jr.", hn)
def test76(self):
hn = HumanName("Dr. Juan Q. de la Vega III")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.middle, "Q.", hn)
self.m(hn.title, "Dr.", hn)
self.m(hn.suffix, "III", hn)
def test77(self):
hn = HumanName("de la Vega, Dr. Juan Q.")
self.m(hn.first, "Juan", hn)
self.m(hn.middle, "Q.", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.title, "Dr.", hn)
def test78(self):
hn = HumanName("de la Vega, Dr. Juan Q., Jr.")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.middle, "Q.", hn)
self.m(hn.suffix, "Jr.", hn)
self.m(hn.title, "Dr.", hn)
def test79(self):
hn = HumanName("de la Vega, Dr. Juan Q. III")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.middle, "Q.", hn)
self.m(hn.suffix, "III", hn)
self.m(hn.title, "Dr.", hn)
def test80(self):
hn = HumanName("Dr. Juan Q. Velasquez y Garcia")
self.m(hn.title, "Dr.", hn)
self.m(hn.middle, "Q.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
def test81(self):
hn = HumanName("Dr. Juan Q. Velasquez y Garcia, Jr.")
self.m(hn.title, "Dr.", hn)
self.m(hn.middle, "Q.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "Jr.", hn)
def test82(self):
hn = HumanName("Dr. Juan Q. Velasquez y Garcia III")
self.m(hn.middle, "Q.", hn)
self.m(hn.title, "Dr.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "III", hn)
def test83(self):
hn = HumanName("Velasquez y Garcia, Dr. Juan Q.")
self.m(hn.title, "Dr.", hn)
self.m(hn.middle, "Q.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
def test84(self):
hn = HumanName("Velasquez y Garcia, Dr. Juan Q., Jr.")
self.m(hn.middle, "Q.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.title, "Dr.", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "Jr.", hn)
def test85(self):
hn = HumanName("Velasquez y Garcia, Dr. Juan Q. III")
self.m(hn.middle, "Q.", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.title, "Dr.", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
self.m(hn.suffix, "III", hn)
def test86(self):
hn = HumanName("Juan Q. Xavier de la Vega")
self.m(hn.first, "Juan", hn)
self.m(hn.middle, "Q. Xavier", hn)
self.m(hn.last, "de la Vega", hn)
def test87(self):
hn = HumanName("Juan Q. Xavier de la Vega, Jr.")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.middle, "Q. Xavier", hn)
self.m(hn.suffix, "Jr.", hn)
def test88(self):
hn = HumanName("Juan Q. Xavier de la Vega III")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.middle, "Q. Xavier", hn)
self.m(hn.suffix, "III", hn)
def test89(self):
hn = HumanName("de la Vega, Juan Q. Xavier")
self.m(hn.first, "Juan", hn)
self.m(hn.middle, "Q. Xavier", hn)
self.m(hn.last, "de la Vega", hn)
def test90(self):
hn = HumanName("de la Vega, Juan Q. Xavier, Jr.")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.middle, "Q. Xavier", hn)
self.m(hn.suffix, "Jr.", hn)
def test91(self):
hn = HumanName("de la Vega, Juan Q. Xavier III")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.middle, "Q. Xavier", hn)
self.m(hn.suffix, "III", hn)
def test92(self):
hn = HumanName("Dr. Juan Q. Xavier de la Vega")
self.m(hn.first, "Juan", hn)
self.m(hn.middle, "Q. Xavier", hn)
self.m(hn.title, "Dr.", hn)
self.m(hn.last, "de la Vega", hn)
def test93(self):
hn = HumanName("Dr. Juan Q. Xavier de la Vega, Jr.")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.title, "Dr.", hn)
self.m(hn.middle, "Q. Xavier", hn)
self.m(hn.suffix, "Jr.", hn)
def test94(self):
hn = HumanName("Dr. Juan Q. Xavier de la Vega III")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.title, "Dr.", hn)
self.m(hn.middle, "Q. Xavier", hn)
self.m(hn.suffix, "III", hn)
def test95(self):
hn = HumanName("de la Vega, Dr. Juan Q. Xavier")
self.m(hn.first, "Juan", hn)
self.m(hn.title, "Dr.", hn)
self.m(hn.middle, "Q. Xavier", hn)
self.m(hn.last, "de la Vega", hn)
def test96(self):
hn = HumanName("de la Vega, Dr. Juan Q. Xavier, Jr.")
self.m(hn.first, "Juan", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.title, "Dr.", hn)
self.m(hn.middle, "Q. Xavier", hn)
self.m(hn.suffix, "Jr.", hn)
def test97(self):
hn = HumanName("de la Vega, Dr. Juan Q. Xavier III")
self.m(hn.first, "Juan", hn)
self.m(hn.title, "Dr.", hn)
self.m(hn.last, "de la Vega", hn)
self.m(hn.middle, "Q. Xavier", hn)
self.m(hn.suffix, "III", hn)
def test98(self):
hn = HumanName("Juan Q. Xavier Velasquez y Garcia")
self.m(hn.middle, "Q. Xavier", hn)
self.m(hn.first, "Juan", hn)
self.m(hn.last, "Velasquez y Garcia", hn)
def test99(self):