Code Comments
Programming Forum and web based access to our favorite programming groups.-----Original Message-----
From: amit hetawal [mailto:amit_h123@rediffmail.com]
Sent: Wednesday, February 22, 2006 16:00
To: Wagner, David --- Senior Programmer Analyst --- WGO
Subject: Re: RE: Re: Tri-grams?
hi there
the sequnce with alpha _ _ is valid but not _ _ _
I replaced the 4 four lines in your program with the following four lines.
next if ( $char !~ /[a-z]/i );
my $char2 = substr $_, $ii+1, 1;
next if ( $char2 !~ /[a-z ]/i );
my $char3 = substr $_, $ii+2, 1;
next if ( $char3 !~ /[a-z ]/i );
Changed the input to
$_ = ' hello. how a,re you hel?lo ';
Output:
$\%hash = {
'e y' => 1,
'ell' => 1,
'hel' => 2,
'how' => 1,
'llo' => 1,
'lo ' => 1,
'ou ' => 1,
'ow ' => 1,
're ' => 1,
'u h' => 1,
'w ' => 1,
'you' => 1
};
Wags ;)
On Thu, 23 Feb 2006 Wagner,David --- Senior Programmer Analyst --- WGO wrote :
>Unclear in that are you saying? Is a__ where _ is a space is valid or can t
hree spaces be valid? So are you working with only alpha and spaces or alpha
, numbers and spaces?
>
>Wags ;)
>
>-----Original Message-----
> From: perl-win32-users-bounces@listserv.ActiveState.com [mailto:perl-win32
-users-bounces@listserv.ActiveState.com]On Behalf Of amit hetawal
>Sent: Wednesday, February 22, 2006 12:09
>To: $Bill Luebkert
>Cc: perl-win32-users@listserv.ActiveState.com
>Subject: Re: Re: Tri-grams?
>
>
>
>
>
>
>On Wed, 22 Feb 2006 $Bill Luebkert 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 plea
se suggest how should i format the file and access the hash values whichi st
ore for all of the whole text ...
>a tri gram with 'ab_' will also work since i have to consider the space asa
character ...too..
>please help :(
>thanks..
>
>
>
>
> <http://adworks.rediff.com/cgi-bin/A...ddle5?PARTNER=3>
>
>
>
> ****************************************
***************
>This message contains information that is confidential
>and proprietary to FedEx Freight or its affiliates.
>It is intended only for the recipient named and for
>the express purpose(s) described therein.
>Any other use is prohibited.
> ****************************************
***************
>
<http://adworks.rediff.com/cgi-bin/A...ddle5?PARTNER=3>
****************************************
***************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
****************************************
***************
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.