Re: Tri-grams?

2006-02-21 Thread $Bill Luebkert
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

RE: Tri-grams?

2006-02-22 Thread Thomas, Mark - BLS CTR
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

Re: Tri-grams?

2006-02-22 Thread $Bill Luebkert
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

Re: Re: Tri-grams?

2006-02-22 Thread amit hetawal
  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

RE: Re: Tri-grams?

2006-02-22 Thread Wagner, David --- Senior Programmer Analyst --- WGO
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