Revision history for Text-Names-Abbreviate
0.04 Fri Jul 10 20:18:12 EDT 2026
[ Enhancements ]
- Unicode NFC normalisation: _normalize_name() now calls
Unicode::Normalize::NFC() before any processing. Strings that differ only
in normalisation form (e.g. precomposed vs. combining-accent forms of the
same character) now produce identical output. Unicode::Normalize is a Perl
core module (no new dependency).
- Surname particle detection: abbreviate() gains a new optional 'particles'
parameter. Lowercase tokens immediately before the last name that appear in
a built-in list (van, de, di, da, von, der, den, des, du, la, le, las, los,
el, al, te, ten, ter, af, av, bin, bint, ibn, y, do, dos, das, del, zu, zum,
zur) are absorbed into the last-name component rather than treated as
middle-name initials. Omit the param or pass 1 to use the built-in list,
pass 0 to disable, or pass an arrayref of strings to supply a custom list.
Matching is case-sensitive: capitalised tokens (Van, De) are not absorbed.
[ Tests ]
- t/unit.t, t/function.t: added use utf8 (required for non-ASCII string
literals); added 7 particle subtests and 4 Unicode subtests in unit.t;
added 7 _extract_parts particle subtests and 2 Unicode normalisation
subtests in function.t; updated _extract_parts spy test to include the
particles argument; added two forwarding subtests for the default and
custom particle lists.
- t/locales.t: updated DE name test to expect 'J. W. von Goethe' (von now
absorbed); added particles => 0 variant to document the old token behaviour.
- t/edge_cases.t: added Section 4b with hostile particles option inputs
(string and hashref rejected; undef and empty-list accepted).
- t/integration.t: added Section 13 with particle pipeline and statefulness
integration tests, including a Unicode + particle combined case.
[ Documentation ]
- Added 'particles' to Args, API SPECIFICATION, MESSAGES, PSEUDOCODE, and
FORMAL SPECIFICATION in module POD.
- Updated LIMITATIONS to document case-sensitivity of particle matching,
the compact/initials + last_first initial behaviour for particle-inclusive
last names, and the NFC normalisation guarantee.
- Updated SYNOPSIS with particle and Unicode examples.
- Updated CLAUDE.md: Architecture, Known pitfalls, and test-table entries.
0.03 Sun Jun 21 07:08:25 EDT 2026
[ Enhancements ]
- Extract _normalize_name and _extract_parts as private helpers
- Add Readonly constants for all format/style/separator magic strings
- Enforce encapsulation with Sub::Private on internal helpers
- Add full POD: LIMITATIONS, MESSAGES, FORMAL SPECIFICATION, PSEUDOCODE
- Add locale test suite (t/locales.t) with BAIL_OUT sanity, per-locale croak checks
[ Bug Fixes ]
- abbreviate(): default format dropped a last name of literally "0"
(e.g. "John 0" gave "J." instead of "J. 0"). The final ternary was
gating on the truthiness of $last_name instead of length($last_name);
"0" is the one non-empty Perl string that is falsy. Found via mutation
testing (xt/mutant_*.t survivor COND_INV_362_2)
[ Tests ]
- Latest test dashboard
- Remove hardcoded test count from t/30-basics.t
- Remove redundant Test::Exception from t/extended_tests.t
- Remove redundant Test::Deep from t/function.t
- Fix missing semicolon in t/extended_tests.t
- Add t/mutant_killers.t: regression tests for the "0" last-name fix
above, plus a property-based guard documenting that COND_INV_362_2 is
an equivalent mutant once the fix is applied
- Skip the "alarm not cancelled by abbreviate" subtest in t/unit.t on
Windows, where alarm() is not reliably implemented
[ Build ]
- Move Readonly to PREREQ_PM (used in module, not just tests)
- Add Sub::Private to PREREQ_PM
0.02 Mon Apr 20 20:25:46 EDT 2026
Use Params::Get
Added fuzz testing in GitHub Actions
Fixed "abbreviate('0')" which gave a Usage error
Fixed edge cases
Expanded on the documentation
Wrote a fuller test suite
0.01 Wed May 28 21:01:16 EDT 2025
First draft