Skip Menu |

This queue is for tickets about the Lingua-Spelling-Alternative CPAN distribution.

Report information
The Basics
Id: 4413
Status: resolved
Priority: 0/
Queue: Lingua-Spelling-Alternative

People
Owner: Nobody in particular
Requestors: carric [...] com2usa.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Can't locate object method "new" via package "Alternative"
I'm trying to get this working and I keep getting errors with the sample code: -------------------------------------------------------------------- use Lingua::Spelling:Alternative; my $en = new Alternative; $en->load_affix('/usr/lib/ispell/english.aff') or die $!; print $en->alternatives("cars"); --------------------------------------------------------------------- First, notice the missing second ":" in the "use" line b/t "Spelling" and "Alternative". I fixed that, and then started getting another error: Can't locate object method "new" via package "Alternative" (perhaps you forgot to load "Alternative"?) at speller.pl line 13. I can see the Alternative.pm [carric@mandanga carric]$ perl -v This is perl, v5.8.0 built for i386-linux-thread-multi Copyright 1987-2002, Larry Wall [carric@mandanga carric]$ uname -a Linux mandanga.home.com2usa.com 2.4.18-19.8.0 #1 Thu Dec 12 05:39:29 EST 2002 i686 i686 i386 GNU/Linux
From: Carric
[guest - Mon Nov 17 19:57:17 2003]: I got it SORT of working by modifying the sample code: use Lingua::Spelling::Alternative; my $en = new Lingua::Spelling::Alternative; $en->load_affix('/usr/lib/ispell/english.aff') or die $!; print $en->alternatives("receive"); For receive howerver, it was spitting out: receivereceerecee I have gotten to: receive recee recee So; progress, but something is still giving me fits. Show quoted text
> I'm trying to get this working and I keep getting errors with the > sample code: > -------------------------------------------------------------------- > use Lingua::Spelling:Alternative; > > my $en = new Alternative; > $en->load_affix('/usr/lib/ispell/english.aff') or die $!; > print $en->alternatives("cars"); > --------------------------------------------------------------------- > > First, notice the missing second ":" in the "use" line
b/t "Spelling" Show quoted text
> and "Alternative". I fixed that, and then started getting another > error: > > Can't locate object method "new" via package "Alternative" (perhaps > you forgot to load "Alternative"?) at speller.pl line 13. > > I can see the Alternative.pm > > [carric@mandanga carric]$ perl -v > > This is perl, v5.8.0 built for i386-linux-thread-multi > > Copyright 1987-2002, Larry Wall > > [carric@mandanga carric]$ uname -a > Linux mandanga.home.com2usa.com 2.4.18-19.8.0 #1 Thu Dec 12 05:39:29 > EST 2002 i686 i686 i386 GNU/Linux > >
alternatives actually returns array of all possible spellings. So, correct example (on the way to CPAN) looks like: use Lingua::Spelling::Alternative; my $en = new Lingua::Spelling::Alternative; $en->load_affix('/usr/lib/ispell/default.aff') or die $!; print join(" ",$en->alternatives("cars")),"\n";