Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement for company names, titles and lastname extensions #40

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
elimination of author, copyright, license in the extended classes
  • Loading branch information
blacksenator committed May 24, 2020
commit 92bdf0c5bb36fad47a9746a7e09c43aee3c5fc54
19 changes: 7 additions & 12 deletions src/Language/German.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,14 @@
use TheIconic\NameParser\LanguageInterface;

/**
* These lists have been extensively supplemented by
* @author Volker Püschel <kuffy@anasco.de>
* @copyright 2019 Volker Püschel
* @license MIT
*
* The only structured definition of name parts and their allowed values
* I could found on the web are according to HL7 (health level 7) standard
* https://simplifier.net/guide/LeitfadenBasisDE/PatientimVersichertenstammdatenmanagementVSDM
* @see https://simplifier.net/guide/LeitfadenBasisDE/PatientimVersichertenstammdatenmanagementVSDM
*
* Names in Germany could be structured like this:
* "[SALUTATION] [TITLES] [FIRSTNAME] [MIDDLENAMES] [EXTENSION] [LASTNAME_PREFIX] [LASTNAME], [SUFFIX]"
* 1 n 1 n 1 1 1 n
* source: https://wiki.hl7.de/index.php?title=bp:Personennamen
* @see https://wiki.hl7.de/index.php?title=bp:Personennamen
*
* Example:
* "Herr Prof. Dr. med. Dr. rer. nat. Fritz Julius Karl Freiherr von und zu Rathenburg vor der Isar, MdB"
Expand All @@ -30,7 +25,7 @@
* "Rathenburg vor der Isar, Fritz Julius Karl Freiherr von und zu"
*/

class German implements LanguageInterface
class German implements LanguageInterface
{
const SUFFIXES = [
'1.' => '1.',
Expand Down Expand Up @@ -64,7 +59,7 @@ class German implements LanguageInterface

/**
* the following list is according to HL7 (Health Level 7) standard
* https://www.vdek.com/vertragspartner/arbeitgeber/deuev/_jcr_content/par/download_8/file.res/Anlage_07_Vers.pdf
* @see https://www.vdek.com/vertragspartner/arbeitgeber/deuev/_jcr_content/par/download_8/file.res/Anlage_07_Vers.pdf
*/
const LASTNAME_PREFIXES = [
'a' => 'a',
Expand Down Expand Up @@ -258,7 +253,7 @@ class German implements LanguageInterface

/**
* the following list is according to HL7 (Health Level 7) standard
* https://www.vdek.com/vertragspartner/arbeitgeber/deuev/_jcr_content/par/download_8/file.res/Anlage_07_Vers.pdf
* @see https://www.vdek.com/vertragspartner/arbeitgeber/deuev/_jcr_content/par/download_8/file.res/Anlage_07_Vers.pdf
*/
const EXTENSIONS = [ // nobility predicate (Adelsprädikate)
'bar' => 'Bar',
Expand Down Expand Up @@ -336,7 +331,7 @@ class German implements LanguageInterface
/**
* the following list contains the academic titles for doctor degrees
* from DACH (Germany, Austria, Swiss)
* copied from wikipedia (https://de.wikipedia.org/wiki/Doktor)
* @see https://de.wikipedia.org/wiki/Doktor
*/
const TITLES_DR = [
'ddr.' => 'DDr.',
Expand Down Expand Up @@ -525,7 +520,7 @@ class German implements LanguageInterface
/**
* the following list contains the academaic titles mainly for professors
* from DACH (Germany, Austria, Swiss), which are often used in names as titles
* copied from wikipedia (https://de.wikipedia.org/wiki/Professor)
* @see https://de.wikipedia.org/wiki/Professor
* this list is kept separate from TITLES to better maintain both
*/
const OFFICIAL_TITLES = [
Expand Down
3 changes: 0 additions & 3 deletions src/Mapper/CompanyMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

/**
* Mapper to identify a string as a company name
* @author Volker Püschel <kuffy@anasco.de>
* @copyright 2019 Volker Püschel
* @license MIT
*/

class CompanyMapper extends AbstractMapper
Expand Down
5 changes: 1 addition & 4 deletions src/Mapper/ExtensionMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@

/**
* Mapper to identify lastname extensions (nobility predicates) in a name
* see /Language/German.php for more information
* @author Volker Püschel <kuffy@anasco.de>
* @copyright 2019 Volker Püschel
* @license MIT
* @see /Language/German.php for more information
*/

class ExtensionMapper extends AbstractMapper
Expand Down
6 changes: 1 addition & 5 deletions src/Mapper/MultipartMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@
* This affects in Germany for example lastname prefixes
* and (academic) titles, which are often consisting
* of several words
* See describing samples in: \Language\German.php:
* @see describing samples in: \Language\German.php:
* LASTNAME_PREFIXES[], TITLES_DR[], OFFICIAL_TITLES[]
* and JOB_TITLES[]
*
* @author Volker Püschel <kuffy@anasco.de>
* @copyright 2019 Volker Püschel
* @license MIT
*/

class MultipartMapper extends AbstractMapper
Expand Down
2 changes: 1 addition & 1 deletion src/Name.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public function getTitle(): string
/**
* get an array with well formated names and their separators,
* where the keys are representing vCard properties
* see: https://tools.ietf.org/html/rfc6350#section-6.2.2
* @see https://tools.ietf.org/html/rfc6350#section-6.2.2
*
* @return array
*/
Expand Down