File: stemmer-no.pl

package info (click to toggle)
libsnowball-norwegian-perl 1.2-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, lenny, squeeze, wheezy
  • size: 904 kB
  • ctags: 10
  • sloc: perl: 210; makefile: 53
file content (21 lines) | stat: -rwxr-xr-x 516 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl
# $Id: stemmer.pl,v 1.1 2007/05/07 11:35:25 ask Exp $
# $Source: /opt/CVS/NoSnowball/examples/stemmer.pl,v $
# $Author: ask $
# $HeadURL$
# $Revision: 1.1 $
# $Date: 2007/05/07 11:35:25 $
use strict;
use warnings;
use Lingua::Stem::Snowball::No;
use vars qw($VERSION);
$VERSION = 1.2;

my $stemmer = Lingua::Stem::Snowball::No->new(use_cache => 1);
while (my $line = <>) {
	chomp $line;
	foreach my $word ((split m/\s+/xms, $line)) {
		my $stemmed = $stemmer->stem($word);
		print "$stemmed\n";
	}
}