The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Unicode::ICU::MessagePattern - ICU’s MessagePattern class

SYNOPSIS

    my $parse = Unicode::ICU::MessagePattern->new('My name is {name}.');

    for my $index ( 0 .. ($parse->count_parts() - 1) ) {
        my $part = $parse->get_part($index);

        # ..
    }

DESCRIPTION

This module exposes useful parts of ICU’s MessagePattern API. It facilitates parsing localizable pattern strings.

COMPATIBILITY

This requires ICU 4.8 or later.

SEE ALSO

Unicode::ICU::MessagePatternPart

METHODS

$obj = CLASS->new( $PATTERN );

Parses $PATTERN and returns an instance of this class.

$count = OBJ->count_parts()

Returns the number of parts in the parse.

$part = OBJ->get_part( $INDEX )

Returns a Unicode::ICU::MessagePatternPart instance that represents the part. ($INDEX is 0-based.)