Hi group,
I am trying to process a hash (words as keys and frequency counts in an
array as values). Instead of just sorting it by values, I want to sort
it by the probabilities and I tried this...
foreach $rule (sort {\compute_probability($b) =
\compute_probability($a)} keys %rules_new) {
You can try this.
$test-{$setup}-{'data'} = [$data[0], $data[1]];
As you said reference is not going to work, if your array value changes at run
time. You can also access specific elements of the array individually, whenever
required.
Baskaran
From:
Hi group,
My Unicode blues continues… One more question on handling Unicode.
Does Tree::Nary module works with Unicode data? I am trying to store some
Unicode strings (UTF-8 to be precise) as Nary Tree.
When I retrieve the value of the nodes from the tree, it produces the output as
-Original Message-
From: Mr. Shawn H. Corey [mailto:[EMAIL PROTECTED]
Sent: 20 March 2006 16:25
To: beginners@perl.org
Subject: Re: Tree:Nary and Unicode
Baskaran Sankaran wrote:
use Tree::Nary;
use warnings;
open(O, children.txt);
binmode (O, :utf8);
open(I
Hi Group,
Am working with Unicode (UTF8 coded) stuff and facing problem with regular
expression.
s/(\p{HinNumerals})\s+($tokenize_string)+\s+(\p{HinNumerals})/$1$2$3/g;
and, my HinNumerals is defined as,
sub HinNumerals {
return END;
0966\t096F
END
}
:56
To: Baskaran Sankaran
Cc: beginners@perl.org
Subject: Re: FW: Reading a Unicode text file
On 2/17/06, Baskaran Sankaran [EMAIL PROTECTED] wrote:
File: Sample_Hin.txt
दूसरे राज्य पुनर्गठन आयोग के गठन का यही सही वक्त है।
The sample files were created in Windows in Unicode (both
Hi group,
Opening a file for output is fine. I've also moved the binmode immediately
after open, outside the loop. But, the error still shows. Now, here are the
sample files and my command would be:
perl number_sent.pl Sample_Eng.txt Sample_Hin.txt Sample_out.txt
File:
Subject: Re: Reading a Unicode text file
Baskaran Sankaran wrote:
Thanks for that but still I do face problem. I did that and it raises
a
warning:
utf8 \xFF does not map to Unicode at second.pl line 8,
$lang_sample_fh line 1.
Excellent, so now we have soem info to start
Hi group,
Is there a source for practical Unicode handling in Perl with example
programs (sort of cook book will be useful)?
Man pages like perlunicode, perluniintro are fine but I feel they are
far less than practical. Any pointers would be great.
Thanks,
Baskaran
Hi,
I am trying to read a Unicode text file and the code fragment is as
below:
$infile = sample_hindi.txt;
$outfile = out.txt;
open(F, :utf8, $infile);
while(F) {
chomp;
binmode ( STDOUT, :utf8 );
print $_;
}
close(F);
The output correctly displays only the
10 matches
Mail list logo