File: stemmer.pl

package info (click to toggle)
libsnowball-norwegian-perl 1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 924 kB
  • ctags: 5
  • sloc: perl: 210; makefile: 5
file content (21 lines) | stat: -rw-r--r-- 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";
	}
}