Lingua::LO::NLP::Analyze - Analyze a Lao syllable and provide accessors to its constituents
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.
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 Unicode::Normalize::NFC and tone mark normalization (see "normalize_tone_marks" in Lingua::LO::NLP::Data). Set this if you are unsure that your text is well-formed according to Unicode rules.
normalize
The original syllable as used by the parser. This may be subtly different from the one passed to the constructor:
If the normalize option was set, tone marks and vowels may have been reordered
If the decomposed form of LAO VOWEL SIGN AM (◌າ) is used, it will have been converted to the composed form
Combinations of ຫ with ລ, ມ or ນ will have been converted to the combined characters.
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.
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 character designated for this function, DOTTED CIRCLE or U+25CC.
The syllable's core consonant.
The end consonant if present, undef otherwise.
undef
The tone mark if present, undef otherwise.
The semivowel following the core consonant if present, undef otherwise.
"ຫ" if the syllable contained a combining ຫ, i.e. one that isn't the core consonant.
The string 'long' or 'short'.
Boolean indicating whether this is a "live" or a "dead" syllable. Dead syllables end in a short vowel or stopped consonant (ກ, ດ or ບ), lives ones end in a long vowel, diphthong, semivowel or nasal consonant. This is used for tone determination but also available as an attribute, just in case it might be useful. true indicates a live syllable.
true
One of the following strings, depending on core consonant class, vowel length and tone mark:
The latter two occur with short vowels, the other ones with long vowels.
To install Lingua::LO::NLP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lingua::LO::NLP
CPAN shell
perl -MCPAN -e shell install Lingua::LO::NLP
For more information on module installation, please visit the detailed CPAN module installation guide.