in reply to Re: arabic alphabet ... how to deal with?
in thread arabic alphabet ... how to deal with?
#!/usr/bin/perl open (STOPWORDS, '<:encoding(UTF-8)', $ARGV[1]) || die "Error opening +the stopwords file\n"; $count = 0; while ($word = <STOPWORDS>) { chop($word); $stopword[$count] = lc($word); $count++; } close(STOPWORDS); open (INFILE ,'<:encoding(UTF-8)', $ARGV[0]) || die "Error opening the + input file\n"; while ($line = <INFILE>) { chop($line); @entry = split(/ /, $line); $i = 0; while ($entry[$i]) { $found = 0; $j = 0; while (($j<=$count) && ($found==0)) { if (lc($entry[$i]) eq $stopword[$j]) { $found = 1; } $j++; } if ($found == 0) { print FH "$entry[$i]\n"; } $i++; } } close(INFILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: arabic alphabet ... how to deal with?
by kennethk (Abbot) on Feb 12, 2009 at 17:22 UTC | |
by Anonymous Monk on Feb 12, 2009 at 17:41 UTC | |
|
Re^3: arabic alphabet ... how to deal with?
by almut (Canon) on Feb 12, 2009 at 21:19 UTC |