Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/nameparser/config/titles.py: 100%

3 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-06-07 06:08 +0000

1# -*- coding: utf-8 -*- 

2from __future__ import unicode_literals 

3 

4FIRST_NAME_TITLES = set([ 

5 'aunt', 

6 'auntie', 

7 'brother', 

8 'dame', 

9 'father', 

10 'king', 

11 'maid', 

12 'master', 

13 'mother', 

14 'pope', 

15 'queen', 

16 'sir', 

17 'sister', 

18 'uncle', 

19 'sheikh', 

20 'sheik', 

21 'shaik', 

22 'shayk', 

23 'shaykh', 

24 'shaikh', 

25 'cheikh', 

26 'shekh', 

27]) 

28""" 

29When these titles appear with a single other name, that name is a first name, e.g. 

30"Sir John", "Sister Mary", "Queen Elizabeth". 

31""" 

32 

33#: **Cannot include things that could also be first names**, e.g. "dean". 

34#: Many of these from wikipedia: https://en.wikipedia.org/wiki/Title. 

35#: The parser recognizes chains of these including conjunctions allowing  

36#: recognition titles like "Deputy Secretary of State". 

37TITLES = FIRST_NAME_TITLES | set([ 

38 "attaché", 

39 "chargé d'affaires", 

40 "king's", 

41 "marchioness", 

42 "marquess", 

43 "marquis", 

44 "marquise", 

45 "queen's", 

46 '10th', 

47 '1lt', 

48 '1sgt', 

49 '1st', 

50 '1stlt', 

51 '1stsgt', 

52 '2lt', 

53 '2nd', 

54 '2ndlt', 

55 '3rd', 

56 '4th', 

57 '5th', 

58 '6th', 

59 '7th', 

60 '8th', 

61 '9th', 

62 'a1c', 

63 'ab', 

64 'abbess', 

65 'abbot', 

66 'abolitionist', 

67 'academic', 

68 'acolyte', 

69 'activist', 

70 'actor ', 

71 'actress', 

72 'adept', 

73 'adjutant', 

74 'adm', 

75 'admiral', 

76 'advertising', 

77 'adviser', 

78 'advocate', 

79 'air', 

80 'akhoond', 

81 'alderman', 

82 'almoner', 

83 'ambassador', 

84 'amn', 

85 'analytics', 

86 'anarchist', 

87 'animator', 

88 'anthropologist', 

89 'appellate', 

90 'apprentice', 

91 'arbitrator', 

92 'archbishop', 

93 'archdeacon', 

94 'archdruid', 

95 'archduchess', 

96 'archduke', 

97 'archeologist', 

98 'architect', 

99 'arhat', 

100 'army', 

101 'arranger', 

102 'assistant', 

103 'assoc', 

104 'associate', 

105 'asst', 

106 'astronomer', 

107 'attache', 

108 'attorney', 

109 'author', 

110 'award-winning', 

111 'ayatollah', 

112 'baba', 

113 'bailiff', 

114 'ballet', 

115 'bandleader', 

116 'banker', 

117 'banner', 

118 'bard', 

119 'baron', 

120 'baroness', 

121 'barrister', 

122 'baseball', 

123 'bearer', 

124 'behavioral', 

125 'bench', 

126 'bg', 

127 'bgen', 

128 'biblical', 

129 'bibliographer', 

130 'biochemist', 

131 'biographer', 

132 'biologist', 

133 'bishop', 

134 'blessed', 

135 'blogger', 

136 'blues', 

137 'bodhisattva', 

138 'bookseller', 

139 'botanist', 

140 'bp', 

141 'brigadier', 

142 'briggen', 

143 'british', 

144 'broadcaster', 

145 'buddha', 

146 'burgess', 

147 'burlesque', 

148 'business', 

149 'businessman', 

150 'businesswoman', 

151 'bwana', 

152 'canon', 

153 'capt', 

154 'captain', 

155 'cardinal', 

156 'cartographer', 

157 'cartoonist', 

158 'catholicos', 

159 'ccmsgt', 

160 'cdr', 

161 'celebrity', 

162 'ceo', 

163 'cfo', 

164 'chair', 

165 'chairs', 

166 'chancellor', 

167 'chaplain', 

168 'chef', 

169 'chemist', 

170 'chief', 

171 'chieftain', 

172 'choreographer', 

173 'civil', 

174 'classical', 

175 'clergyman', 

176 'clerk', 

177 'cmsaf', 

178 'cmsgt', 

179 'co-chair', 

180 'co-chairs', 

181 'co-founder', 

182 'coach', 

183 'col', 

184 'collector', 

185 'colonel', 

186 'comedian', 

187 'comedienne', 

188 'comic', 

189 'commander', 

190 'commander-in-chief', 

191 'commodore', 

192 'composer', 

193 'compositeur', 

194 'comptroller', 

195 'computer', 

196 'comtesse', 

197 'conductor', 

198 'consultant', 

199 'controller', 

200 'corporal', 

201 'corporate', 

202 'correspondent', 

203 'councillor', 

204 'counselor', 

205 'count', 

206 'countess', 

207 'courtier', 

208 'cpl', 

209 'cpo', 

210 'cpt', 

211 'credit', 

212 'criminal', 

213 'criminologist', 

214 'critic', 

215 'csm', 

216 'curator', 

217 'customs', 

218 'cwo-2', 

219 'cwo-3', 

220 'cwo-4', 

221 'cwo-5', 

222 'cwo2', 

223 'cwo3', 

224 'cwo4', 

225 'cwo5', 

226 'cyclist', 

227 'dancer', 

228 'dcn', 

229 'deacon', 

230 'delegate', 

231 'deputy', 

232 'designated', 

233 'designer', 

234 'detective', 

235 'developer', 

236 'diplomat', 

237 'dir', 

238 'director', 

239 'discovery', 

240 'dissident', 

241 'district', 

242 'division', 

243 'do', 

244 'docent', 

245 'docket', 

246 'doctor', 

247 'doyen', 

248 'dpty', 

249 'dr', 

250 'dra', 

251 'dramatist', 

252 'druid', 

253 'drummer', 

254 'duchesse', 

255 # 'duke', # a common first name 

256 'dutchess', 

257 'ecologist', 

258 'economist', 

259 'editor', 

260 'edmi', 

261 'edohen', 

262 'educator', 

263 'effendi', 

264 'ekegbian', 

265 'elerunwon', 

266 'eminence', 

267 'emperor', 

268 'empress', 

269 'engineer', 

270 'english', 

271 'ens', 

272 'entertainer', 

273 'entrepreneur', 

274 'envoy', 

275 'essayist', 

276 'evangelist', 

277 'excellency', 

278 'excellent', 

279 'exec', 

280 'executive', 

281 'expert', 

282 'fadm', 

283 'family', 

284 'federal', 

285 'field', 

286 'film', 

287 'financial', 

288 'first', 

289 'flag', 

290 'flying', 

291 'foreign', 

292 'forester', 

293 'founder', 

294 'fr', 

295 'friar', 

296 'gaf', 

297 'gen', 

298 'general', 

299 'generalissimo', 

300 'gentiluomo', 

301 'giani', 

302 'goodman', 

303 'goodwife', 

304 'governor', 

305 'graf', 

306 'grand', 

307 'group', 

308 'guitarist', 

309 'guru', 

310 'gyani', 

311 'gysgt', 

312 'hajji', 

313 'headman', 

314 'heir', 

315 'heiress', 

316 'her', 

317 'hereditary', 

318 'high', 

319 'highness', 

320 'his', 

321 'historian', 

322 'historicus', 

323 'historien', 

324 'holiness', 

325 'hon', # sorry Hon Solo, but judges seem more common. 

326 'honorable', 

327 'honourable', 

328 'host', 

329 'illustrator', 

330 'imam', 

331 'industrialist', 

332 'information', 

333 'instructor', 

334 'intelligence', 

335 'intendant', 

336 'inventor', 

337 'investigator', 

338 'investor', 

339 'journalist', 

340 'journeyman', 

341 'jr', 

342 'judge', 

343 'judicial', 

344 'junior', 

345 'jurist', 

346 'keyboardist', 

347 'kingdom', 

348 'knowledge', 

349 'lady', 

350 'lama', 

351 'lamido', 

352 'law', 

353 'lawyer', 

354 'lcdr', 

355 'lcpl', 

356 'leader', 

357 'lecturer', 

358 'legal', 

359 'librarian', 

360 'lieutenant', 

361 'linguist', 

362 'literary', 

363 'lord', 

364 'lt', 

365 'ltc', 

366 'ltcol', 

367 'ltg', 

368 'ltgen', 

369 'ltjg', 

370 'lyricist', 

371 'madam', 

372 'madame', 

373 'mademoiselle', 

374 'mag', 

375 'mag-judge', 

376 'mag/judge', 

377 'magistrate', 

378 'magistrate-judge', 

379 'magnate', 

380 'maharajah', 

381 'maharani', 

382 'mahdi', 

383 'maj', 

384 'majesty', 

385 'majgen', 

386 'manager', 

387 'marcher', 

388 'marchess', 

389 'marketing', 

390 'marquis', 

391 'mathematician', 

392 'mathematics', 

393 'matriarch', 

394 'mayor', 

395 'mcpo', 

396 'mcpoc', 

397 'mcpon', 

398 'md', 

399 'member', 

400 'memoirist', 

401 'merchant', 

402 'met', 

403 'metropolitan', 

404 'mg', 

405 'mgr', 

406 'mgysgt', 

407 'military', 

408 'minister', 

409 'miss', 

410 'misses', 

411 'missionary', 

412 'mister', 

413 'mlle', 

414 'mme', 

415 'mobster', 

416 'model', 

417 'monk', 

418 'monsignor', 

419 'most', 

420 'mountaineer', 

421 'mpco-cg', 

422 'mr', 

423 'mrs', 

424 'ms', 

425 'msg', 

426 'msgt', 

427 'mufti', 

428 'mullah', 

429 'municipal', 

430 'murshid', 

431 'musician', 

432 'musicologist', 

433 'mx', 

434 'mystery', 

435 'nanny', 

436 'narrator', 

437 'national', 

438 'naturalist', 

439 'navy', 

440 'neuroscientist', 

441 'novelist', 

442 'nurse', 

443 'obstetritian', 

444 'officer', 

445 'opera', 

446 'operating', 

447 'ornithologist', 

448 'painter', 

449 'paleontologist', 

450 'pastor', 

451 'patriarch', 

452 'pediatrician', 

453 'personality', 

454 'petty', 

455 'pfc', 

456 'pharaoh', 

457 'phd', 

458 'philantropist', 

459 'philosopher', 

460 'photographer', 

461 'physician', 

462 'physicist', 

463 'pianist', 

464 'pilot', 

465 'pioneer', 

466 'pir', 

467 'player', 

468 'playwright', 

469 'po1', 

470 'po2', 

471 'po3', 

472 'poet', 

473 'police', 

474 'political', 

475 'politician', 

476 'prefect', 

477 'prelate', 

478 'premier', 

479 'pres', 

480 'presbyter', 

481 'president', 

482 'presiding', 

483 'priest', 

484 'priestess', 

485 'primate', 

486 'prime', 

487 'prin', 

488 'prince', 

489 'princess', 

490 'principal', 

491 'printer', 

492 'printmaker', 

493 'prior', 

494 'private', 

495 'pro', 

496 'producer', 

497 'prof', 

498 'professor', 

499 'provost', 

500 'pslc', 

501 'psychiatrist', 

502 'psychologist', 

503 'publisher', 

504 'pursuivant', 

505 'pv2', 

506 'pvt', 

507 'rabbi', 

508 'radio', 

509 'radm', 

510 'rangatira', 

511 'ranger', 

512 'rdml', 

513 'rear', 

514 'rebbe', 

515 'registrar', 

516 'rep', 

517 'representative', 

518 'researcher', 

519 'resident', 

520 'rev', 

521 'revenue', 

522 'reverend', 

523 'right', 

524 'risk', 

525 'rock', 

526 'royal', 

527 'rt', 

528 'sa', 

529 'sailor', 

530 'saint', 

531 'sainte', 

532 'saoshyant', 

533 'satirist', 

534 'scholar', 

535 'schoolmaster', 

536 'scientist', 

537 'scpo', 

538 'screenwriter', 

539 'se', 

540 'secretary', 

541 'security', 

542 'seigneur', 

543 'senator', 

544 'senior', 

545 'senior-judge', 

546 'sergeant', 

547 'servant', 

548 'sfc', 

549 'sgm', 

550 'sgt', 

551 'sgtmaj', 

552 'sgtmajmc', 

553 'shehu', 

554 'sheikh', 

555 'sheriff', 

556 'siddha', 

557 'singer', 

558 'singer-songwriter', 

559 'sma', 

560 'smsgt', 

561 'sn', 

562 'soccer', 

563 'social', 

564 'sociologist', 

565 'software', 

566 'soldier', 

567 'solicitor', 

568 'soprano', 

569 'spc', 

570 'speaker', 

571 'special', 

572 'sr', 

573 'sra', 

574 'srta', 

575 'ssg', 

576 'ssgt', 

577 'st', 

578 'staff', 

579 'state', 

580 'states', 

581 'strategy', 

582 'subaltern', 

583 'subedar', 

584 'suffragist', 

585 'sultan', 

586 'sultana', 

587 'superior', 

588 'supreme', 

589 'surgeon', 

590 'swami', 

591 'swordbearer', 

592 'sysselmann', 

593 'tax', 

594 'teacher', 

595 'technical', 

596 'technologist', 

597 'television ', 

598 'tenor', 

599 'theater', 

600 'theatre', 

601 'theologian', 

602 'theorist', 

603 'timi', 

604 'tirthankar', 

605 'translator', 

606 'travel', 

607 'treasurer', 

608 'tsar', 

609 'tsarina', 

610 'tsgt', 

611 'uk', 

612 'united', 

613 'us', 

614 'vadm', 

615 'vardapet', 

616 'vc', 

617 'venerable', 

618 'verderer', 

619 'vicar', 

620 'vice', 

621 'viscount', 

622 'vizier', 

623 'vocalist', 

624 'voice', 

625 'warden', 

626 'warrant', 

627 'wing', 

628 'wm', 

629 'wo-1', 

630 'wo1', 

631 'wo2', 

632 'wo3', 

633 'wo4', 

634 'wo5', 

635 'woodman', 

636 'writer', 

637 'zoologist', 

638])