1 package Text::Tradition::Language::English;
5 use Text::Tradition::Language::Base qw/ lemmatize_treetagger reading_lookup_treetagger /;
10 Text::Tradition::Language::English - language-specific module for English
14 Implements morphology lookup for English words in context. This module
15 depends on the TreeTagger software
16 (L<http://www.ims.uni-stuttgart.de/projekte/corplex/TreeTagger/>), which is
17 (for now) expected to be installed in $MORPHDIR/TreeTagger.
21 =head2 lemmatize( $text )
23 Evaluates the string using the TreeTagger, and returns the results.
27 binmode STDOUT, ':utf8';
29 use_ok( 'Text::Tradition::Language::English' );
36 my $tradition = shift;
38 'language' => 'English',
39 'callback' => sub { _parse_wordform( @_ ) }
41 return lemmatize_treetagger( $tradition, %opts );
44 =head2 reading_lookup( $rdg[, $rdg, ...] )
46 Looks up one or more readings using the Flemm package, and returns the
47 possible results. This uses the same logic as L<lemmatize> above for the
48 entire tradition, but can also be used to (re-)analyze individual readings.
55 'language' => 'French',
56 'callback' => sub { _parse_wordform( @_ ) },
59 return reading_lookup_treetagger( %opts );
62 # Utility function to turn a TreeTagger result into a WordForm
64 my $tagresult = shift;
65 my( $orig, $tag, $lemma ) = split( /\t/, $tagresult );
66 my $morphobj = Lingua::TagSet::TreeTagger->tag2structure( $tag );
68 return Text::Tradition::Collation::Reading::WordForm->new(
69 'language' => 'English',
71 'morphology' => $morphobj,
74 warn "No morphology found for word: $_";
90 This package is free software and is provided "as is" without express
91 or implied warranty. You can redistribute it and/or modify it under
92 the same terms as Perl itself.
96 Tara L Andrews E<lt>aurum@cpan.orgE<gt>