in reply to Installing Lingua BrillTagger

If you look at http://matrix.cpantesters.org/?dist=Lingua-BrillTagger+0.02 you will see that nobody has installed that module -- I wouldn't even try :)

I would try Lingua::EN::Tagger instead

Replies are listed 'Best First'.
Re^2: Installing Lingua BrillTagger
by Mordan (Initiate) on Jan 20, 2014 at 07:58 UTC
    Thank you superdoc, I would have kept trying if you hadn't said! LinguaTagger is okay but I am having problems getting the tag output out. I can get the tagged sentence out from it, just not the count of indiviudal tags (so like "<NN> = 2").
      If that is a question, can you show small code sample, complete with small input and word description of what counts you expect?

        Thanks. So using Lingua::EN::Tagger code below I can get the output of a file all tagged. But I still can't work out how just to display the tags.

        Looking at the .pm file I cannot see an obvious way for it to output, say, <NN> : 2, <CC> : 5 and so on. I can only see subs to add_tag to text, not just to display them.

        #!/usr/bin/env perl use Lingua::EN::Tagger qw(add_tags); my $postagger = new Lingua::EN::Tagger; my $file = "test.txt"; my $text = do { local $/ = undef; open my $fh, "<", $file or die "could not open $file: $!"; <$fh>; }; my $tagged = $postagger->add_tags($text); print $tagged, "\n";