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

Lingua::LO::NLP::Romanize - Romanize Lao syllables

FUNCTION

This s a factory class for Lingua::LO::NLP::Romanize::*. Currently there is only Lingua::LO::NLP::Romanize::PCGN but other variants are planned.

SYNOPSIS

    my $o = Lingua::LO::NLP::Romanize->new(
        variant => 'PCGN',
        hyphen => 1,
    );

METHODS

new

See "SYNOPSIS" on how to use the constructor. Arguments supported are:

variant: Standard according to which to romanize. "PCGN" is the only one currently implemented.
hyphen: Separate runs of Lao syllables with hyphens. Set this to the character you would like to use as a hyphen - usually this will be the ASCII "hyphen minus" (U+002D) but it can be the unambiguous Unicode hyphen ("‐", U+2010), a slash or anything you like. As a special case, you can pass a 1 to use the ASCII version. If this argument is missing or undef, blanks are used. Syllables duplicated using "ໆ" are always joined with a hyphen: either the one you specify or the ASCII one.
normalize: Run text through tone mark order normalization; see "normalize_tone_marks" in Lingua::LO::NLP::Data. If your text looks fine but syllables are not recognized, you may need this.

romanize

    romanize( $text )

Return the romanization of $text according to the standard passed to the constructor. Text is split up by "get_fragments" in Lingua::LO::NLP::Syllabify; Lao syllables are processed and everything else is passed through unchanged save for possible conversion of combining characters to a canonically equivalent form in "NFC" in Unicode::Normalize.

romanize_syllable

    romanize_syllable( $syllable )

Return the romanization of a single $syllable according to the standard passed to the constructor. This is a virtual method that must be implemented by subclasses.

hyphen my $hypen = $o->hyphen; $o->hyphen('-');

Accessor for the hyphen attribute, see "new".

normalize my $normalization = $o->normalize; $o->normalize( $bool );

Accessor for the normalize attribute, see "new".