Here you go

#!/usr/bin/perl -- ## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if " -otr -opr +-ce -nibc -i=4 -pt=0 "-nsak=*" use strict; use warnings; use Data::Dump qw/ dd /; use Lingua::EN::Tagger ; Main( @ARGV ); exit( 0 ); sub Main { my $text = q{ If that is a question, can you show small code sample, complete with small input and word description of what counts you expect? Now <brackets> here :/ }; my $postagger = Lingua::EN::Tagger->new; my $tagged = $postagger->add_tags($text); #~ dd( $postagger, $tagged ); #~ dd ( map { [ $_, $postagger->$_( $text ) ] } qw{ get_words get_ +readable get_sentences } ); #~ dd ( map { [ $_, $postagger->$_( $tagged ) ] } qw{ get_proper_n +ouns get_nouns get_max_noun_phrases get_noun_phrases } ); dd( scalar $postagger->get_tag_counts( $tagged ) ); } ## end sub Main sub Lingua::EN::Tagger::get_tag_counts { #~ my( $self, $tagged ) = @_; my %counts; $counts{$1}++ while $_[1] =~ m{<([^>/]+)>}g; return wantarray ? %counts : \%counts; } __END__ { cc => 1, det => 2, in => 3, jj => 3, md => 1, nn => 6, pp => 1, ppc => 2, prp => 2, rb => 2, sym => 1, vbp => 2, vbz => 2, wp => 1, }

In reply to Re^5: Installing Lingua BrillTagger ( sub Lingua::EN::Tagger::get_tag_counts ) by Anonymous Monk
in thread Installing Lingua BrillTagger by Mordan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.