NAME

PersonName::Format::FieldModifier - Default CLDR person-name field modifiers

SYNOPSIS

my $modifier = PersonName::Format::FieldModifier->new(
    'en-GB',
    data => $cldr,
);

my $result = $pattern->format(
    $name,
    modifier_resolver => $modifier,
);

DESCRIPTION

This class provides the default implementation of the CLDR allCaps, initialCap, initial, monogram, and retain modifiers. genitive and vocative are no-op fallbacks when the name object has not consumed them.

The locale-specific initial and initialSequence patterns are loaded from Locale::Unicode::Data through the locale inheritance tree. Explicit patterns may be supplied for isolated tests or specialised callers.

The implementation is pure Perl and compatible with Perl v5.10.1. Grapheme selection uses Perl's \X. Locale-sensitive word breaking and casing may be replaced later by optional XS primitives without changing this API.

METHODS

data

Returns the Locale::Unicode::Data provider.

initial_pattern

Returns the pattern used to decorate one initial.

initial_sequence_pattern

Returns the pattern used to join a sequence of formatted initials.

locale

Returns the Locale::Unicode locale object.

resolve

Applies one supported modifier. Its arguments match the resolver callback contract used by PersonName::Format::Pattern.

resolver

Returns a callback suitable for modifier_resolver.

AUTHOR

Jacques Deguest <jack@deguest.jp>

COPYRIGHT & LICENSE

Copyright(c) 2026 DEGUEST Pte. Ltd.

All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.