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

Ham::Reference::Phonetics - A quick reference for the ITU Phonetic Alphabet.

VERSION

Version 0.02

SYNOPSIS

 use Ham::Reference::Phonetics;

 my $phonetics = Ham::Reference::Phonetics->new(
        space => '<space>'
 );

 # use the get() function to get a string of phonetics

 print $phonetics->get('abc xyz');
 print "\n";

 # use the get_array() function to get an array of phonetics
 # with each one in an element

 my $arrayref = $phonetics->get_arrayref('abc xyz');
 foreach (@$arrayref) {
        print "$_\n";
 }

 # use a hash reference to get all phonetics
 # the following will display all letters and corresponding phonetics

 my $hashref = $phonetics->get_hashref();
 foreach (sort keys %$hashref)
 {
        print "$_ = $hashref->{$_}\n";
 }

DESCRIPTION

The Ham::Reference::Phonetics module is a quick reference to the ITU phonetic alphabet suggested by the ARRL for Amateur Radio use. Other phonetic alphabets may be included in the future. Some can already be found in Lingua::Alphabet::Phonetic.

CONSTRUCTOR

new()

 Usage    : my $phonetics = Ham::Reference::Phonetics->new();
 Function : creates a new Ham::Reference::Phonetics object
 Returns  : A Ham::Reference::Phonetics object
 Args     : an anonymous hash:
            key           required?   value
            -------       ---------   -----
            phonetic_set  no          select the phonetic alphabet set
                                      the only set for now, and the default set
                                      is itu
            space         no          set a string to represent a space when
                                      using methods to convert to phonetics
                                      default is an empty string

METHODS

get()

 Usage    : my $string = $phonetics->get( 'this is my string' );
 Function : converts a string to a string of corresponding phonetic words
 Returns  : a string
 Args     : a string

get_arrayref()

 Usage    : my $arrayref = $phonetics->get_arrayref( 'this is my string' );
 Function : converts a string to an array reference of corresponding phonetic words
            one phonetic word per element
 Returns  : an array reference
 Args     : a string

get_hashref()

 Usage    : my $hashref = $phonetics->get_hashref();
 Function : get the phonetic alphabet in a hash referenece
 Returns  : a hash reference
 Args     : n/a

ACKNOWLEDGEMENTS

The ITU phonetic alphabet for Amateur Radio use was taken from http://www.arrl.org/FandES/field/forms/fsd220.html#alphabet, courtesy of the American Radio Relay League.

SEE ALSO

Other phonetic alphabets can found in Lingua::Alphabet::Phonetic.

AUTHOR

Brad McConahay N8QQ, <brad at n8qq.com>

COPYRIGHT & LICENSE

Ham::Reference::Phonetics is Copyright (C) 2008-2010 Brad McConahay N8QQ.

This module is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license in the file LICENSE.

This program is distributed in the hope that it will be useful, but it is provided "as is" and without any express or implied warranties. For details, see the full text of the license in the file LICENSE.