프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$dict | - Common honorific prefixes (english) - Common compound surname identifiers - Common suffixes (lineage and professional) Note: longer professional titles should appear earlier in the array than shorter titles to reduce the risk of mis-identification e.g. BEng before BE Also note that case and periods are part of the matching for professional titles and therefore need to be correct, there are no case conversions | ||
$not_nicknames |
메소드 | 설명 | |
---|---|---|
break_words ( string $name ) : array | Breaks name into individual words | |
fix_case ( $word ) | # ucfirst all upper/lower strings, but leave camelcase words alone | |
get_pro_suffix ( string $name ) : mixed | Checks for the existence of, and returns professional suffix | |
parse ( string $name ) : array | Parse Static entry point. | |
parse_name ( $full_name ) : array | This is the primary method which calls all other methods | |
safe_ucfirst ( $seperator, $word ) | # helper public function for fix_case |
메소드 | 설명 | |
---|---|---|
get_nickname ( string $name ) : mixed | Function to check name for existence of nickname based on these stipulations - String wrapped in parentheses (string) - String wrapped in double quotes "string" x String wrapped in single quotes 'string' | |
is_camel_case ( string $word ) : boolean | Checks for camelCase words such as McDonald and MacElroy | |
is_compound ( string $word ) : boolean | Checks our dictionary of compound indicators to see if last name is compound | |
is_initial ( string $word ) : boolean | Test string to see if it's a single letter/initial (period optional) | |
is_line_suffix ( string $word, string $name ) : mixed | Checks word against array of common lineage suffixes | |
is_salutation ( string $word ) : boolean | Checks word against list of common honorific prefixes |
public break_words ( string $name ) : array | ||
$name | string | the full name you wish to parse |
리턴 | array | full list of words broken down by spaces |
public fix_case ( $word ) |
protected get_nickname ( string $name ) : mixed | ||
$name | string | the name you wish to test against |
리턴 | mixed | returns nickname if exists, false otherwise |
public get_pro_suffix ( string $name ) : mixed | ||
$name | string | the name you wish to test |
리턴 | mixed | returns the suffix if exists, false otherwise |
protected is_camel_case ( string $word ) : boolean | ||
$word | string | the single word you wish to test |
리턴 | boolean |
protected is_compound ( string $word ) : boolean | ||
$word | string | the single word you wish to test |
리턴 | boolean |
protected is_initial ( string $word ) : boolean | ||
$word | string | the single word you wish to test |
리턴 | boolean |
protected is_salutation ( string $word ) : boolean | ||
$word | string | the single word you wish to test |
리턴 | boolean |
public parse_name ( $full_name ) : array | ||
리턴 | array | returns associative array of name parts |
public safe_ucfirst ( $seperator, $word ) |
protected $dict |