sub add_content { my $self = shift; my $content = shift; $words = [ split(/\s+/, $content) ]; for ($i=0; $i < scalar(@$words) ; $i++) { my $first_word = lc($words->[$i]); my $second_word = lc($words->[$i+1]); # 2 word phrases if ($self->is_relevant_word($first_word , $second_word) && $first_word ne "$second_word") { my $phrase = $first_word . " " . $second_word; $self->{_related}{$phrase}++; $self->_rate_phrase($phrase); } } }