/[Lingua-Spelling-Alternative]/test.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /test.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by dpavlin, Mon Feb 11 14:33:42 2002 UTC revision 1.3 by dpavlin, Mon Feb 11 20:19:59 2002 UTC
# Line 6  use strict; Line 6  use strict;
6  my $affix_file='/usr/lib/ispell/english.aff';  my $affix_file='/usr/lib/ispell/english.aff';
7  my @test_words=( 'cars', 'dogs' );  my @test_words=( 'cars', 'dogs' );
8    
9    my $findaffix_file='./findaffix.out';
10    
11  my $loaded = 0;  my $loaded = 0;
12    
13  BEGIN { $| = 1; print "1..4\n"; }  BEGIN { $| = 1; print "1..6\n"; }
14  END {print "not ok 1\n" unless $loaded;}  END {print "not ok 1\n" unless $loaded;}
15    
16  use Lingua::Spelling::Alternative;  use Lingua::Spelling::Alternative;
# Line 23  defined($a) || print 'not '; print "ok 2 Line 25  defined($a) || print 'not '; print "ok 2
25    
26  ### test load affix  ### test load affix
27    
   
28  if ( -e $affix_file ) {  if ( -e $affix_file ) {
29          my $ok = $a->load_affix($affix_file);          my $ok = $a->load_affix($affix_file);
30          print 'not ' if (! $ok);          print 'not ' if (! $ok);
# Line 37  if ( -e $affix_file ) { Line 38  if ( -e $affix_file ) {
38          print "ok 4 # - Skip\n";          print "ok 4 # - Skip\n";
39  }  }
40    
41    undef $a;
42    
43    ### test load findaffix
44    
45    if ( -e $findaffix_file ) {
46            my $a = new Lingua::Spelling::Alternative( DEBUG => 1 ) ;
47    
48            my $ok = $a->load_findaffix($findaffix_file);
49            print 'not ' if (! $ok);
50            print "ok 5\n";
51    
52            my @words = $a->alternatives(@test_words);
53            print 'not ' if (! @words);
54            print "ok 6 # - ",join(", ",@test_words)," -> ",join(", ",@words),"\n";
55    } else {
56            print "ok 5 # - Skip, findaffix file '$findaffix_file' not found\n";
57            print "ok 6 # - Skip\n";
58    }
59    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.26