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