| 1 | ## -*- Mode: CPerl -*- | ||
| 2 | ## | ||
| 3 | ## File: DTA::CAB::Analyzer::EqRW::FST.pm | ||
| 4 | ## Author: Bryan Jurish <moocow@cpan.org> | ||
| 5 | ## Description: phonetic equivalence class expansion via Gfsm::Automaton | ||
| 6 | |||
| 7 | ##============================================================================== | ||
| 8 | ## Package: Analyzer::Morph | ||
| 9 | ##============================================================================== | ||
| 10 | package DTA::CAB::Analyzer::EqRW::FST; | ||
| 11 | use DTA::CAB::Analyzer::Automaton::Gfsm; | ||
| 12 | use Carp; | ||
| 13 | use strict; | ||
| 14 | our @ISA = qw(DTA::CAB::Analyzer::Automaton::Gfsm); | ||
| 15 | |||
| 16 | ## $obj = CLASS_OR_OBJ->new(%args) | ||
| 17 | ## + object structure: see DTA::CAB::Analyzer::Automaton::Gfsm, DTA::CAB::Analyzer::Automaton | ||
| 18 | sub new { | ||
| 19 | my $that = shift; | ||
| 20 | my $aut = $that->SUPER::new( | ||
| 21 | ##-- overrides | ||
| 22 | #tolower => 0, | ||
| 23 | #check_symbols => 0, | ||
| 24 | #typeKeys => ['eqrw'], | ||
| 25 | |||
| 26 | ##-- analysis selection | ||
| 27 | #analysisClass => 'DTA::CAB::Analyzer::EqRW::FST::Analysis', | ||
| 28 | label => 'eqrw', | ||
| 29 | analyzeGet => ('($_[0]{rw} && @{$_[0]{rw}} ? (map {$_->{hi}} @{$_[0]{rw}})' | ||
| 30 | .': ($_[0]{xlit} ? $_[0]{xlit}{latin1Text} : $_[0]{text}))'), | ||
| 31 | analyzeSet => $DTA::CAB::Analyzer::Automaton::DEFAULT_ANALYZE_SET, | ||
| 32 | attInput => 1, | ||
| 33 | wantAnalysisLo => 1, | ||
| 34 | #allowTextRegex => '(?:^[[:alpha:]\-]*[[:alpha:]]+$)|(?:^[[:alpha:]]+[[:alpha:]\-]+$)', | ||
| 35 | allowTextRegex => DTA::CAB::Analyzer::_am_wordlike_regex(), | ||
| 36 | #allowWordRegex => '.', | ||
| 37 | |||
| 38 | ##-- user args | ||
| 39 | @_ | ||
| 40 | ); | ||
| 41 | return $aut; | ||
| 42 | } | ||
| 43 | |||
| 44 | 1; ##-- be happy | ||
| 45 | |||
| 46 | __END__ |