Jean Tavernier > HTML-Content-Extractor > HTML::WordTagRatio::WeightedRatio

Download:
HTML-Content-Extractor-0.01.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View Bugs
Report a bug
Source  

NAME ^

HTML::WordTagRatio::WeightedRatio - Perl module for determining the ratio of words to tags in a range of tokens in an HTML document.

SYNOPSIS ^

  use HTML::WordTagRatio::WeightedRatio;
  use HTML::Content::HTMLTokenizer;
  use HTML::Content::ContentExtractor;
  
  my $tokenizer = new HTML::Content::HTMLTokenizer('TAG','WORD');
  
  open(HTML,"index.html");
  my $doc = join("",<HTML>);
  close(HTML);
  
  my ($word_count_arr_ref,$tag_count_arr_ref,$token_type_arr_ref,$token_hash_ref) = $tokenizer->Tokenize($doc);
  
  my $ratio = new HTML::WordTagRatio::WeightedRatio();
    
  my $value = $ratio->RangeValue(0, @$word_count_arr_ref, 
                                $word_count_arr_ref, $tag_count_arr_ref);

DESCRIPTION ^

HTML::WordTagRatio::WeightedRatio computes a ratio of Words to Tags for a given range. In psuedo code, the ratio is

Words^2/(Words + Tags)

Methods

AUTHOR ^

Jean Tavernier (jj.tavernier@gmail.com)

COPYRIGHT ^

Copyright 2005 Jean Tavernier. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

ContentExtractorDriver.pl (1), HTML::Content::HTMLTokenizer (3), HTML::Content::ContentExtractor (3), HTML::WordTagRatio::Ratio (3), HTML::WordTagRatio::SmoothedRatio (3), HTML::WordTagRatio::RelativeRatio (3), HTML::WordTagRatio::ExponentialRatio (3), HTML::WordTagRatio::NormalizedRatio (3).