Skip to content

v1.3.0

Choose a tag to compare

@iliaal iliaal released this 10 Jul 12:53
· 89 commits to master since this release
v1.3.0
2468fc9

Added

  • Dutch honorifics (Dhr., Mevr., Mw.) in the default parser, so "Dhr. Jan de Vries" reads the title as a salutation instead of a first name.
  • Legal credential JD, so "King, Michelle JD, LPC" keeps both credentials in the suffix.
  • Name::getSource() returns the normalized input the name was parsed from (null for a manually constructed Name), the same string getConfidence() assesses.

Changed

  • Name::toArray()['given_name'] is now documented as first, middle, and initials only. Use full_name when you need the given name plus surname.
  • Custom mapper lists set with setMappers() now survive setMaxCombinedInitials(), setMaxSalutationIndex(), and setNicknameDelimiters(). Passing an empty list resets the parser to the default pipeline.
  • Hostile inputs (kilobytes of unmatched quotes, 100 KB tokens of any case shape, megabyte rows) now parse in linear time and bounded memory.
  • LanguageInterface documents the dictionary key format: keys must already be normalized (lowercase, periods removed, no edge punctuation) as Text::key() produces, and may be int or string, so a numeric ordinal like the German "2." keys under the bare digit.
  • Export is faster on large batches; a full parse-plus-toArray() row is net faster than 1.2.0, while raw parse() alone is slightly slower from the new credential and comma safeguards.

Fixed

  • Credential-only rows such as "Jane DDS" and initial-plus-credential rows such as "John A. MD" now keep the credential in the suffix instead of rewriting it as the last name.
  • All-caps short given names stay intact beside mixed-case salutations or credentials, so "JO ANDERSON PhD" keeps first name Jo.
  • Parenthetical credentials such as "Jane Doe (MD)" now parse as suffixes instead of nicknames.
  • Comma surname segments with real given names keep non-particle compound surnames and left-side suffixes, so "Hidalgo Castillo, Maria" and "Doe Jr, John" parse as expected.
  • Interrupted credential tails keep recognized credentials in the suffix while preserving name-like bridge tokens; placeholder/punctuation noise such as "Unknown" or "-" is stripped from the tail, including immediately before the first credential ("Jane Doe Unknown MD").
  • Bare single-letter roman numerals stay part of the name instead of becoming a suffix, so "Malcolm X" keeps X as the last name. Multi-letter forms ("John III") still parse as suffixes.
  • A trailing comma with nothing after it ("John Smith MD,") no longer appends a trailing space to the first name.
  • Nicknames preserve internal apostrophes, so "John (O'Brien) Smith" keeps O'Brien.
  • Single-token salutations such as "Mr" now parse as salutations under the default salutation scan.
  • Trailing punctuation no longer blocks credential lookup for tokens such as "MD;" and "MD)".
  • Unknown trailing credentials are kept when a known credential anchors the tail, so "John Smith MD FACS" keeps both MD and FACS in the suffix instead of leaking FACS into the name. Uniform all-caps rows still cannot recover an unknown credential (casing carries no signal there).
  • A credential-only segment after the given name is pulled out to the suffix, so "Smith, MD, John" keeps first name John and credential MD instead of reading MD as a name. Mixed given-plus-credential tails ("John Smith, MD, FACS") keep all credentials.
  • A leading credential run in the given segment maps to the suffix, so "Smith, MD John" keeps first name John and credential MD instead of shredding MD into initials.
  • The confidence pass keys punctuation-wrapped tokens the same way the parser does, so "NGUYEN, VI;" is flagged as ambiguous instead of slipping past on the trailing semicolon.
  • German ordinal suffixes are recognized, so "Friedrich Wilhelm 2." keeps 2. as the suffix (the ordinal keys under the bare digit).
  • Caseless-script names are not split into initials, so "Wang, 李明" keeps 李明 as the first name instead of splitting it into two initials.
  • Comma-form initials use the whole input's casing, so "Smith, JM" splits JM into J and initial M (the mixed-case surname proves the signal) while all-caps "SMITH, JM" keeps Jm as a first name.
  • Surname-first parsing handles a leading salutation and a credential-only tail, so "Dr. Kim Jong Un" keeps surname Kim (not the title) and "Kim Jong Un, MD" keeps surname Kim with credential MD instead of falling back to Western order.
  • A comma inside a delimited nickname no longer bisects the name and survives into the nickname, for bracketed, quoted, and custom multi-character forms alike: "John (Bob, Jr) Doe", "John 'Bob, Jr' Doe", and "John <<Bob, Jr>> Doe" (with ['<<' => '>>']) keep nickname "Bob, Jr", and the given-side "Smith, John (Jack, Robert)" keeps "Jack, Robert" whole.
  • An all-caps token behind a preserved name token stays combined initials, so "John Paul JM Smith MD" keeps initials J M; an unknown credential is only recognized inside the contiguous run at the tail.
  • Surname-first input with both a leading salutation and a credential-only comma tail keeps the surname, so "Dr. Kim Jong Un, MD" gives surname Kim, salutation Dr., and credential MD.
  • Multibyte custom whitespace (U+3000, NBSP) no longer corrupts unrelated glyphs that share its bytes; the collapse pattern matches whole characters. A whitespace set that is not valid UTF-8 keeps the old bytewise semantics instead of warning on every parse.
  • Invalid-UTF-8 nickname delimiter keys are ignored instead of emitting a compile warning per token.
  • Nickname delimiters accept multibyte and multi-character opener/closer pairs, and empty-string delimiter keys are ignored instead of emitting a warning per parse.
  • An elided surname particle survives instead of being read as an unterminated nickname or an initial, so "'t Hooft" keeps the leading particle.
  • Spaced parentheses yield a clean nickname, so "John ( Bob ) Smith" gives nickname Bob without stray spaces, and a delimiter pair that cleans to nothing emits no nickname at all.
  • A name part that normalizes to "0" survives getAll() and the string cast, so "Jane 0" is not silently dropped.
  • setWhitespace('') no longer emits a warning per parse; an empty whitespace set simply skips the collapse step.