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::Analyze - Analyze a Lao syllable and provide accessors to its constituents

FUNCTION

Objects of this class represent a Lao syllable with an analysis of its constituents. After passing a valid syllable to the constructor, the parts are available via accessor methods as outlined below.

METHODS

new

new( $syllable, %options )

The constructor takes a syllable and any number of options as hash-style arguments. The only option specified so far is "normalize", a boolean value indicating whether to run the syllable through tone mark normalization (see "normalize_tone_marks" in Lingua::LO::NLP::Data). It does not fail but may produce nonsense if the argument is not valid according to Lao morphology rules.

If your input comes from Lingua::LO::NLP::Syllabify, it has already been validated and comes in the correct tone mark order, so you may save a few microseconds by not setting validate => 1, otherwise it's generally a good idea to set it.

ACCESSORS

syllable

The original syllable as passed to the constructor

parse

A hash of raw constituents as returned by the parsing regexp. Although the other accessors present constituents in a more accessible way and take care of morphological special cases like the treatment of ຫ, this may come in handy to quickly check e.g. if there was a vowel component before the core consonant.

vowel

The syllable's vowel or diphthong. As the majority of vowels have more than one code point, the consonant position is represented by the unicode sign designated for this function, DOTTED CIRCLE or U+25CC.

consonant

The syllable's core consonant

end_consonant

The end consonant if present, undef otherwise.

tone_mark

The tone mark if present, undef otherwise.

semivowel

The semivowel following the core consonant if present, undef otherwise.

h

"ຫ" if the syllable contained a combining ຫ, i.e. one that isn't the core consonant.

vowel_length

The string 'long' or 'short'.

tone

One of the following strings, depending on core consonant class, vowel length and tone mark:

LOW_RISING
LOW
HIGH
MID_FALLING
HIGH_FALLING
MID_STOP
HIGH_STOP

The latter two occur with short vowels, the other ones with long vowels.