Lingua::Phonology::FileFormatPOD 0.32 review

Download
by rbytes.net on

Lingua::Phonology::FileFormatPOD is a Perl module that contains documentation for the xml file format written and read by Lingua::Pho

License: Perl Artistic License
File size: 97K
Developer: Jesse S. Bangs
0 stars award from rbytes.net

Lingua::Phonology::FileFormatPOD is a Perl module that contains documentation for the xml file format written and read by Lingua::Phonology.

As of v0.3, Lingua::Phonology is able to read and write an XML file that defines a complete Lingua::Phonology object. This file is meant to be human-editable, so you can write a phonology definition in a text file and then load it using Lingua::Phonology. Your perl script itself can be quite minimal, as most of the work of creating your phonology is done in the file.

For example, the following script reads the phonology defined in my_phono.xml, then reads a list of underlying forms from STDIN, applies the rules to them, and writes the surface forms to phono.out.

use Lingua::Phonology;

my $phono = new Lingua::Phonology;

$phono->loadfile('my_phono.xml');

open OUT, '>phono.out' or die $!;

while (< >) {
chomp $_;

# The following assumes one word per line. It also assumes that all of
# our symbols are one character and that there are no diacritics.
# Implementing this script if any of the preceding are false is left as
# an exercise to the reader.
@word = $phono->symbols->segment(split //, $_);

$phono->rules->apply_all(@word);

print OUT $phono->symbols->spell(@word), "n";
}

Of course, having this be successful depends on my_phono.xml working properly. The rest of this document describes how to do that.

Requirements:
Perl

Lingua::Phonology::FileFormatPOD 0.32 keywords