| 1 | ## -*- Mode: CPerl -*- | ||
| 2 | ## | ||
| 3 | ## File: DTA::CAB::Analyzer::GermaNet::Hyperonyms.pm | ||
| 4 | ## Author: Bryan Jurish <moocow@cpan.org> | ||
| 5 | ## Description: GermaNet relation expander: hyperonymy (superclasses) | ||
| 6 | |||
| 7 | package DTA::CAB::Analyzer::GermaNet::Hypernyms; | ||
| 8 | use DTA::CAB::Analyzer::GermaNet::RelationClosure; | ||
| 9 | use Carp; | ||
| 10 | use strict; | ||
| 11 | |||
| 12 | ##============================================================================== | ||
| 13 | ## Globals | ||
| 14 | ##============================================================================== | ||
| 15 | |||
| 16 | our @ISA = qw(DTA::CAB::Analyzer::GermaNet::RelationClosure); | ||
| 17 | |||
| 18 | ##============================================================================== | ||
| 19 | ## Constructors etc. | ||
| 20 | ##============================================================================== | ||
| 21 | |||
| 22 | ## $obj = CLASS_OR_OBJ->new(%args) | ||
| 23 | ## + object structure: | ||
| 24 | ## ( | ||
| 25 | ## ##-- OVERRIDES in Hyperonyms | ||
| 26 | ## relations => ['hyperonymy'], ##-- override | ||
| 27 | ## label => 'gn-isa', ##-- override | ||
| 28 | ## | ||
| 29 | ## ##-- INHERITED from GermaNet::RelationClosure | ||
| 30 | ## relations => \@relns, ##-- relations whose closure to compute | ||
| 31 | ## analyzeGet => $code, ##-- accessor: coderef or string: source text (default=$DEFAULT_ANALYZE_GET; return undef for no analysis) | ||
| 32 | ## allowRegex => $regex, ##-- only analyze types matching $regex | ||
| 33 | ## | ||
| 34 | ## ##-- INHERITED from Analyzer::GermaNet | ||
| 35 | ## gnFile=> $dirname_or_binfile, ##-- default: none | ||
| 36 | ## gn => $gn_obj, ##-- underlying GermaNet object | ||
| 37 | ## max_depth => $depth, ##-- default maximum closure depth for relation_closure() [default=128] | ||
| 38 | ## label => $lab, ##-- analyzer label | ||
| 39 | ## ) | ||
| 40 | sub new { | ||
| 41 | my $that = shift; | ||
| 42 | my $gna = $that->SUPER::new( | ||
| 43 | ##-- overrides | ||
| 44 | relations => [qw(has_hypernym)], | ||
| 45 | label => 'gn-isa', | ||
| 46 | |||
| 47 | ##-- user args | ||
| 48 | @_ | ||
| 49 | ); | ||
| 50 | return $gna; | ||
| 51 | } | ||
| 52 | |||
| 53 | ##============================================================================== | ||
| 54 | ## Alias DTA::CAB::Analyzer::GermaNet::Hyperonyms | ||
| 55 | package DTA::CAB::Analyzer::GermaNet::Hyperonyms; | ||
| 56 | use strict; | ||
| 57 | our @ISA = qw(DTA::CAB::Analyzer::GermaNet::Hypernyms); | ||
| 58 | |||
| 59 | ##============================================================================== | ||
| 60 | ## Alias DTA::CAB::Analyzer::GermaNet::Hyperonymy | ||
| 61 | package DTA::CAB::Analyzer::GermaNet::Hyperonymy; | ||
| 62 | use strict; | ||
| 63 | our @ISA = qw(DTA::CAB::Analyzer::GermaNet::Hypernyms); | ||
| 64 | |||
| 65 | ##============================================================================== | ||
| 66 | ## Alias DTA::CAB::Analyzer::GermaNet::isa | ||
| 67 | package DTA::CAB::Analyzer::GermaNet::isa; | ||
| 68 | use strict; | ||
| 69 | our @ISA = qw(DTA::CAB::Analyzer::GermaNet::Hypernyms); | ||
| 70 | |||
| 71 | |||
| 72 | 1; ##-- be happy | ||
| 73 | |||
| 74 | __END__ |