amit hetawal wrote:
>
> Hello All,
> I needed some logic behind the code for text analysis. its like i have
> to calculate the frequency of the each of the tri-grams present in a
> given piece of text
> i.e i need a way to get the number of occurence of 't' follwoed by 'he'
> for the word 'the
And here's the "abuse of a regex" version. I recommend $Bill's version
instead. :)
$_ = "hello how are you hello";
s/([^ ])(?=([^ ][^ ]))/$t{$1.$2}++/eg;
use Data::Dumper;
print Data::Dumper::Dumper(\%t);
--
Mark Thomas
Internet Systems Architect
___
BAE SY
amit hetawal wrote:
> Hello Bill
> Thanks for your help...
> i got the initial part running but now i have so read the text from a
> large text file havin all the sentences and special characters and in
> that i have to get the trigrams working and not only for the above text
> ...can you please s
On Wed, 22 Feb 2006 $Bill Luebkert wrote :
>amit hetawal wrote:
>
> >
> > Hello All,
> > I needed some logic behind the code for text analysis. its like i have
> > to calculate the frequency of the each of the tri-grams present in a
> > given piece of text
> > i.e i need a way to get the nu
hetawalSent: Wednesday, February 22, 2006
12:09To: $Bill LuebkertCc:
perl-win32-users@listserv.ActiveState.comSubject: Re: Re:
Tri-grams?
On Wed, 22 Feb 2006 $Bill Luebkert wrote :>amit hetawal
wrote:>> >> > Hello All,> > I
needed some logic behind the code for