blib/lib/Text/English.pm

filter: Statementstmt 92.3% 24 / 26 Branchbran 83.3% 20 / 24 Conditioncond 75.3% 153 / 203 MC/DCmcdc 5.4% 4 / 74 Subroutinesub 100% 1 / 1 Podpod 0.0% 0 / 1 totaltotal 61.4% 202 / 329 CC 81 SCAR 50.4
CC
81
Cov
78%
stem
153.9
CRAP 153.9
« perlindex ↑ Summary
1 #!/usr/bin/perl
2 # -*- Mode: Perl -*-
3 # Author : Ian Phillipps
4 # Last Modified On: Sun May 2 15:35:33 2004
5 # Language : CPerl
6  
7 package Text::English;
8  
9 2 $VERSION = $VERSION = '0.01';
10  
11 680 ▶sub stem {
Subroutine stem: called CC=81 SCAR=50.4
Pod undocumented
12 680 my @parms = @_;
13 680 foreach( @parms ) {
14 680 $_ = lc $_;
15  
16 # Step 0 - remove punctuation
17 680 s/'s$//; s/^[^a-z]+//; s/[^a-z]+$//;
18 680 ▶ next unless /^[a-z]+$/;
Branch: 1 branch
BranchTrueFalseTotal
unless /^[a-z]+$/ 6 674 680
19  
20 # step1a_rules
21 674 ▶ if( /[^s]s$/ ) { s/sses$/ss/ || s/ies$/i/ || s/s$// }
Branch: 2 branches
BranchTrueFalseTotal
if (/[^s]s$/) 66 608 674
s/sses$/ss/ or s/ies$/i/ or s/s$// 1 65 66
Condition66%2/3
s/sses$/ss/ or s/ies$/i/
l!l&&r!l&&!r
0165
MC/DC50%1/2
s/sses$/ss/ or s/ies$/i/
s/sses$/ss/ s/ies$/i/
Truth table66%2/3
A or B
A= s/sses$/ss/B= s/ies$/i/
ABresult
1X1
011
000
22
23 # step1b_rules. The business with rule==106 is embedded in the
24 # boolean expressions here.
25 674 ▶ (/[aeiouy][^aeiouy].*eed$/ && s/eed$/ee/ ) ||
Branch: 1 branch
BranchTrueFalseTotal
/[aeiouy][^aeiouy].*eed$/ and s/eed$/ee/ or s/([aeiou].*)ed$/$1/ || s/([aeiouy].*)ing$/$1/ and s/at$/ate/ || s/bl$/ble/ || s/iz$/ize/ || s/bb$/b/ || s/dd$/d/ || s/ff$/f/ || s/gg$/g/ || s/mm$/m/ || s/nn$/n/ || s/pp$/p/ || s/rr$/r/ || s/tt$/t/ || s/ww$/w/ || s/xx$/x/ || s/^[^aeiouy]+[aeiouy][^aeiouy]$/$&e/ 1 673 674
Condition75%40/53
/[aeiouy][^aeiouy].*eed$/ && s/eed$/ee/ || (s/([aeiou].*)ed$/$1/ || s/([aeiouy].*)ing$/$1/) && (s/at$/ate/ || s/bl$/ble/ || s/iz$/ize/ || s/bb$/b/ || s/dd$/d/ || s/ff$/f/ || s/gg$/g/ || s/mm$/m/ || s/nn$/n/ || s/pp$/p/ || s/rr$/r/ || s/tt$/t/ || s/ww$/w/ || s/xx$/x/ || s/^[^aeiouy]+[aeiouy][^aeiouy]$/$&e/)
l!l
16730
/[aeiouy][^aeiouy].*eed$/ and s/eed$/ee/
!ll&&!rl&&r
67301
s/([aeiou].*)ed$/$1/ || s/([aeiouy].*)ing$/$1/ and s/at$/ate/ || s/bl$/ble/ || s/iz$/ize/ || s/bb$/b/ || s/dd$/d/ || s/ff$/f/ || s/gg$/g/ || s/mm$/m/ || s/nn$/n/ || s/pp$/p/ || s/rr$/r/ || s/tt$/t/ || s/ww$/w/ || s/xx$/x/ || s/^[^aeiouy]+[aeiouy][^aeiouy]$/$&e/
!ll
63241
s/([aeiou].*)ed$/$1/ or s/([aeiouy].*)ing$/$1/
l!l&&r!l&&!r
1625632
s/at$/ate/ or s/bl$/ble/ or s/iz$/ize/ or s/bb$/b/ or s/dd$/d/ or s/ff$/f/ or s/gg$/g/ or s/mm$/m/ or s/nn$/n/ or s/pp$/p/ or s/rr$/r/ or s/tt$/t/ or s/ww$/w/ or s/xx$/x/ or s/^[^aeiouy]+[aeiouy][^aeiouy]$/$&e/
l!l
8330
s/at$/ate/ or s/bl$/ble/ or s/iz$/ize/ or s/bb$/b/ or s/dd$/d/ or s/ff$/f/ or s/gg$/g/ or s/mm$/m/ or s/nn$/n/ or s/pp$/p/ or s/rr$/r/ or s/tt$/t/ or s/ww$/w/ or s/xx$/x/
l!l&&r!l&&!r
8033
s/at$/ate/ or s/bl$/ble/ or s/iz$/ize/ or s/bb$/b/ or s/dd$/d/ or s/ff$/f/ or s/gg$/g/ or s/mm$/m/ or s/nn$/n/ or s/pp$/p/ or s/rr$/r/ or s/tt$/t/ or s/ww$/w/
l!l&&r!l&&!r
8033
s/at$/ate/ or s/bl$/ble/ or s/iz$/ize/ or s/bb$/b/ or s/dd$/d/ or s/ff$/f/ or s/gg$/g/ or s/mm$/m/ or s/nn$/n/ or s/pp$/p/ or s/rr$/r/ or s/tt$/t/
l!l&&r!l&&!r
6233
s/at$/ate/ or s/bl$/ble/ or s/iz$/ize/ or s/bb$/b/ or s/dd$/d/ or s/ff$/f/ or s/gg$/g/ or s/mm$/m/ or s/nn$/n/ or s/pp$/p/ or s/rr$/r/
l!l&&r!l&&!r
6035
s/at$/ate/ or s/bl$/ble/ or s/iz$/ize/ or s/bb$/b/ or s/dd$/d/ or s/ff$/f/ or s/gg$/g/ or s/mm$/m/ or s/nn$/n/ or s/pp$/p/
l!l&&r!l&&!r
6035
s/at$/ate/ or s/bl$/ble/ or s/iz$/ize/ or s/bb$/b/ or s/dd$/d/ or s/ff$/f/ or s/gg$/g/ or s/mm$/m/ or s/nn$/n/
l!l&&r!l&&!r
5135
s/at$/ate/ or s/bl$/ble/ or s/iz$/ize/ or s/bb$/b/ or s/dd$/d/ or s/ff$/f/ or s/gg$/g/ or s/mm$/m/
l!l&&r!l&&!r
5036
s/at$/ate/ or s/bl$/ble/ or s/iz$/ize/ or s/bb$/b/ or s/dd$/d/ or s/ff$/f/ or s/gg$/g/
l!l&&r!l&&!r
5036
s/at$/ate/ or s/bl$/ble/ or s/iz$/ize/ or s/bb$/b/ or s/dd$/d/ or s/ff$/f/
l!l&&r!l&&!r
5036
s/at$/ate/ or s/bl$/ble/ or s/iz$/ize/ or s/bb$/b/ or s/dd$/d/
l!l&&r!l&&!r
4136
s/at$/ate/ or s/bl$/ble/ or s/iz$/ize/ or s/bb$/b/
l!l&&r!l&&!r
4037
s/at$/ate/ or s/bl$/ble/ or s/iz$/ize/
l!l&&r!l&&!r
4037
s/at$/ate/ or s/bl$/ble/
l!l&&r!l&&!r
4037
MC/DC0%0/19
/[aeiouy][^aeiouy].*eed$/ && s/eed$/ee/ || (s/([aeiou].*)ed$/$1/ || s/([aeiouy].*)ing$/$1/) && (s/at$/ate/ || s/bl$/ble/ || s/iz$/ize/ || s/bb$/b/ || s/dd$/d/ || s/ff$/f/ || s/gg$/g/ || s/mm$/m/ || s/nn$/n/ || s/pp$/p/ || s/rr$/r/ || s/tt$/t/ || s/ww$/w/ || s/xx$/x/ || s/^[^aeiouy]+[aeiouy][^aeiouy]$/$&e/)
too many conditions
26 ( s/([aeiou].*)ed$/$1/ || s/([aeiouy].*)ing$/$1/ ) &&
27 ( # step1b1_rules
28 s/at$/ate/ || s/bl$/ble/ || s/iz$/ize/ || s/bb$/b/ ||
29 s/dd$/d/ || s/ff$/f/ || s/gg$/g/ || s/mm$/m/ ||
30 s/nn$/n/ || s/pp$/p/ || s/rr$/r/ || s/tt$/t/ ||
31 s/ww$/w/ || s/xx$/x/ ||
32 # This is wordsize==1 && CVC...addanE...
33 s/^[^aeiouy]+[aeiouy][^aeiouy]$/$&e/
34 )
35 #DEBUG && warn "step1b1: $_\n"
36 ;
37 # step1c_rules
38 #DEBUG warn "step1c: $_\n" if
39 674 s/([aeiouy].*)y$/$1i/;
40  
41 # step2_rules
42  
43 674 ▶ if ( s/ational$/ate/ || s/tional$/tion/ || s/enci$/ence/ ||
Branch: 1 branch
BranchTrueFalseTotal
if (s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/ or s/eli$/e/ or s/ousli$/ous/ or s/ization$/ize/ or s/isation$/ise/ or s/ation$/ate/ or s/ator$/ate/ or s/alism$/al/ or s/iveness$/ive/ or s/fulnes$/ful/ or s/ousness$/ous/ or s/aliti$/al/ or s/iviti$/ive/ or s/biliti$/ble/) 11 663 674
Condition74%47/63
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/ or s/eli$/e/ or s/ousli$/ous/ or s/ization$/ize/ or s/isation$/ise/ or s/ation$/ate/ or s/ator$/ate/ or s/alism$/al/ or s/iveness$/ive/ or s/fulnes$/ful/ or s/ousness$/ous/ or s/aliti$/al/ or s/iviti$/ive/ or s/biliti$/ble/
l!l&&r!l&&!r
110663
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/ or s/eli$/e/ or s/ousli$/ous/ or s/ization$/ize/ or s/isation$/ise/ or s/ation$/ate/ or s/ator$/ate/ or s/alism$/al/ or s/iveness$/ive/ or s/fulnes$/ful/ or s/ousness$/ous/ or s/aliti$/al/ or s/iviti$/ive/
l!l&&r!l&&!r
110663
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/ or s/eli$/e/ or s/ousli$/ous/ or s/ization$/ize/ or s/isation$/ise/ or s/ation$/ate/ or s/ator$/ate/ or s/alism$/al/ or s/iveness$/ive/ or s/fulnes$/ful/ or s/ousness$/ous/ or s/aliti$/al/
l!l&&r!l&&!r
110663
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/ or s/eli$/e/ or s/ousli$/ous/ or s/ization$/ize/ or s/isation$/ise/ or s/ation$/ate/ or s/ator$/ate/ or s/alism$/al/ or s/iveness$/ive/ or s/fulnes$/ful/ or s/ousness$/ous/
l!l&&r!l&&!r
110663
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/ or s/eli$/e/ or s/ousli$/ous/ or s/ization$/ize/ or s/isation$/ise/ or s/ation$/ate/ or s/ator$/ate/ or s/alism$/al/ or s/iveness$/ive/ or s/fulnes$/ful/
l!l&&r!l&&!r
110663
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/ or s/eli$/e/ or s/ousli$/ous/ or s/ization$/ize/ or s/isation$/ise/ or s/ation$/ate/ or s/ator$/ate/ or s/alism$/al/ or s/iveness$/ive/
l!l&&r!l&&!r
110663
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/ or s/eli$/e/ or s/ousli$/ous/ or s/ization$/ize/ or s/isation$/ise/ or s/ation$/ate/ or s/ator$/ate/ or s/alism$/al/
l!l&&r!l&&!r
110663
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/ or s/eli$/e/ or s/ousli$/ous/ or s/ization$/ize/ or s/isation$/ise/ or s/ation$/ate/ or s/ator$/ate/
l!l&&r!l&&!r
110663
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/ or s/eli$/e/ or s/ousli$/ous/ or s/ization$/ize/ or s/isation$/ise/ or s/ation$/ate/
l!l&&r!l&&!r
92663
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/ or s/eli$/e/ or s/ousli$/ous/ or s/ization$/ize/ or s/isation$/ise/
l!l&&r!l&&!r
90665
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/ or s/eli$/e/ or s/ousli$/ous/ or s/ization$/ize/
l!l&&r!l&&!r
90665
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/ or s/eli$/e/ or s/ousli$/ous/
l!l&&r!l&&!r
90665
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/ or s/eli$/e/
l!l&&r!l&&!r
63665
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/
l!l&&r!l&&!r
51668
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/
l!l&&r!l&&!r
41669
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/
l!l&&r!l&&!r
40670
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/
l!l&&r!l&&!r
40670
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/
l!l&&r!l&&!r
40670
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/
l!l&&r!l&&!r
40670
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/
l!l&&r!l&&!r
13670
s/ational$/ate/ or s/tional$/tion/
l!l&&r!l&&!r
01673
MC/DC0%0/22
s/ational$/ate/ or s/tional$/tion/ or s/enci$/ence/ or s/anci$/ance/ or s/izer$/ize/ or s/iser$/ise/ or s/abli$/able/ or s/alli$/al/ or s/entli$/ent/ or s/eli$/e/ or s/ousli$/ous/ or s/ization$/ize/ or s/isation$/ise/ or s/ation$/ate/ or s/ator$/ate/ or s/alism$/al/ or s/iveness$/ive/ or s/fulnes$/ful/ or s/ousness$/ous/ or s/aliti$/al/ or s/iviti$/ive/ or s/biliti$/ble/
too many conditions
44 s/anci$/ance/ || s/izer$/ize/ || s/iser$/ise/ ||
45 s/abli$/able/ || s/alli$/al/ || s/entli$/ent/ ||
46 s/eli$/e/ || s/ousli$/ous/ || s/ization$/ize/ ||
47 s/isation$/ise/ || s/ation$/ate/ || s/ator$/ate/ ||
48 s/alism$/al/ || s/iveness$/ive/ || s/fulnes$/ful/ ||
49 s/ousness$/ous/ || s/aliti$/al/ || s/iviti$/ive/ ||
50 s/biliti$/ble/
51 ) {
52 11 my ($l,$m) = ($`,$&);
53 #DEBUG warn "step 2: l=$l m=$m\n";
54 11 ▶ $_ = $l.$m unless $l =~ /[^aeiou][aeiouy]/;
Branch: 1 branch
BranchTrueFalseTotal
unless $l =~ /[^aeiou][aeiouy]/ 0 11 11
55 }
56 # step3_rules
57 674 ▶ if ( s/icate$/ic/ || s/ative$// || s/alize$/al/ ||
Branch: 1 branch
BranchTrueFalseTotal
if (s/icate$/ic/ or s/ative$// or s/alize$/al/ or s/iciti$/ic/ or s/ical$/ic/ or s/ful$// or s/ness$//) 0 674 674
Condition33%6/18
s/icate$/ic/ or s/ative$// or s/alize$/al/ or s/iciti$/ic/ or s/ical$/ic/ or s/ful$// or s/ness$//
l!l&&r!l&&!r
00674
s/icate$/ic/ or s/ative$// or s/alize$/al/ or s/iciti$/ic/ or s/ical$/ic/ or s/ful$//
l!l&&r!l&&!r
00674
s/icate$/ic/ or s/ative$// or s/alize$/al/ or s/iciti$/ic/ or s/ical$/ic/
l!l&&r!l&&!r
00674
s/icate$/ic/ or s/ative$// or s/alize$/al/ or s/iciti$/ic/
l!l&&r!l&&!r
00674
s/icate$/ic/ or s/ative$// or s/alize$/al/
l!l&&r!l&&!r
00674
s/icate$/ic/ or s/ative$//
l!l&&r!l&&!r
00674
MC/DC0%0/7
s/icate$/ic/ or s/ative$// or s/alize$/al/ or s/iciti$/ic/ or s/ical$/ic/ or s/ful$// or s/ness$//
s/icate$/ic/ s/ative$// s/alize$/al/ s/iciti$/ic/ s/ical$/ic/ s/ful$// s/ness$//
Truth table12%1/8
A or B or C or D or E or F or G
A= s/icate$/ic/B= s/ative$//C= s/alize$/al/D= s/iciti$/ic/E= s/ical$/ic/F= s/ful$//G= s/ness$//
ABCDEFGresult
1XXXXXX1
01XXXXX1
001XXXX1
0001XXX1
00001XX1
000001X1
00000011
00000000
58 s/iciti$/ic/ || s/ical$/ic/ || s/ful$// ||
59 s/ness$//
60 ) {
61 0 my ($l,$m) = ($`,$&);
62 #DEBUG warn "step 3: l=$l m=$m\n";
63 0 ▶ $_ = $l.$m unless $l =~ /[^aeiou][aeiouy]/;
Branch: 1 branch
BranchTrueFalseTotal
unless $l =~ /[^aeiou][aeiouy]/ 0 0 0
64 }
65  
66 # step4_rules
67 674 ▶ if ( s/al$// || s/ance$// || s/ence$// || s/er$// ||
Branch: 1 branch
BranchTrueFalseTotal
if (s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$// or s/ement$// or s/ment$// or s/ent$// or s/sion$/s/ or s/tion$/t/ or s/ou$// or s/ism$// or s/ate$// or s/iti$// or s/ous$// or s/ive$// or s/ize$// or s/ise$//) 105 569 674
Condition86%52/60
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$// or s/ement$// or s/ment$// or s/ent$// or s/sion$/s/ or s/tion$/t/ or s/ou$// or s/ism$// or s/ate$// or s/iti$// or s/ous$// or s/ive$// or s/ize$// or s/ise$//
l!l&&r!l&&!r
1041569
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$// or s/ement$// or s/ment$// or s/ent$// or s/sion$/s/ or s/tion$/t/ or s/ou$// or s/ism$// or s/ate$// or s/iti$// or s/ous$// or s/ive$// or s/ize$//
l!l&&r!l&&!r
1040570
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$// or s/ement$// or s/ment$// or s/ent$// or s/sion$/s/ or s/tion$/t/ or s/ou$// or s/ism$// or s/ate$// or s/iti$// or s/ous$// or s/ive$//
l!l&&r!l&&!r
1022570
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$// or s/ement$// or s/ment$// or s/ent$// or s/sion$/s/ or s/tion$/t/ or s/ou$// or s/ism$// or s/ate$// or s/iti$// or s/ous$//
l!l&&r!l&&!r
1020572
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$// or s/ement$// or s/ment$// or s/ent$// or s/sion$/s/ or s/tion$/t/ or s/ou$// or s/ism$// or s/ate$// or s/iti$//
l!l&&r!l&&!r
1020572
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$// or s/ement$// or s/ment$// or s/ent$// or s/sion$/s/ or s/tion$/t/ or s/ou$// or s/ism$// or s/ate$//
l!l&&r!l&&!r
939572
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$// or s/ement$// or s/ment$// or s/ent$// or s/sion$/s/ or s/tion$/t/ or s/ou$// or s/ism$//
l!l&&r!l&&!r
930581
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$// or s/ement$// or s/ment$// or s/ent$// or s/sion$/s/ or s/tion$/t/ or s/ou$//
l!l&&r!l&&!r
876581
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$// or s/ement$// or s/ment$// or s/ent$// or s/sion$/s/ or s/tion$/t/
l!l&&r!l&&!r
789587
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$// or s/ement$// or s/ment$// or s/ent$// or s/sion$/s/
l!l&&r!l&&!r
771596
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$// or s/ement$// or s/ment$// or s/ent$//
l!l&&r!l&&!r
734597
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$// or s/ement$// or s/ment$//
l!l&&r!l&&!r
6112601
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$// or s/ement$//
l!l&&r!l&&!r
610613
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$//
l!l&&r!l&&!r
610613
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$//
l!l&&r!l&&!r
610613
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$//
l!l&&r!l&&!r
601613
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$//
l!l&&r!l&&!r
600614
s/al$// or s/ance$// or s/ence$// or s/er$//
l!l&&r!l&&!r
1347614
s/al$// or s/ance$// or s/ence$//
l!l&&r!l&&!r
67661
s/al$// or s/ance$//
l!l&&r!l&&!r
51668
MC/DC0%0/21
s/al$// or s/ance$// or s/ence$// or s/er$// or s/ic$// or s/able$// or s/ible$// or s/ant$// or s/ement$// or s/ment$// or s/ent$// or s/sion$/s/ or s/tion$/t/ or s/ou$// or s/ism$// or s/ate$// or s/iti$// or s/ous$// or s/ive$// or s/ize$// or s/ise$//
too many conditions
68 s/ic$// || s/able$// || s/ible$// || s/ant$// ||
69 s/ement$// || s/ment$// || s/ent$// || s/sion$/s/ ||
70 s/tion$/t/ || s/ou$// || s/ism$// || s/ate$// ||
71 s/iti$// || s/ous$// || s/ive$// || s/ize$// ||
72 s/ise$//
73 ) {
74 105 my ($l,$m) = ($`,$&);
75 # Look for two consonant/vowel transitions
76 # NB simplified...
77 #DEBUG warn "step 4: l=$l m=$m\n";
78 105 ▶ $_ = $l.$m unless $l =~ /[^aeiou][aeiouy].*[^aeiou][aeiouy]/;
Branch: 1 branch
BranchTrueFalseTotal
unless $l =~ /[^aeiou][aeiouy].*[^aeiou][aeiouy]/ 62 43 105
79 }
80  
81 # step5a_rules
82 #DEBUG warn("step 5a: $_\n") &&
83 674 ▶ s/e$// if ( /[^aeiou][aeiouy].*[^aeiou][aeiouy].*e$/ ||
Branch: 1 branch
BranchTrueFalseTotal
if /[^aeiou][aeiouy].*[^aeiou][aeiouy].*e$/ or /[aeiou][^aeiouy].*e/ and not /[^aeiou][aeiouy][^aeiouwxy]e$/ 174 500 674
Condition100%6/6
/[^aeiou][aeiouy].*[^aeiou][aeiouy].*e$/ or /[aeiou][^aeiouy].*e/ and not /[^aeiou][aeiouy][^aeiouwxy]e$/
l!l&&r!l&&!r
33141500
/[aeiou][^aeiouy].*e/ and not /[^aeiou][aeiouy][^aeiouwxy]e$/
!ll&&!rl&&r
44060141
MC/DC100%3/3
/[^aeiou][aeiouy].*[^aeiou][aeiouy].*e$/ or /[aeiou][^aeiouy].*e/ and not /[^aeiou][aeiouy][^aeiouwxy]e$/
/[^aeiou][aeiouy].*[^aeiou][aeiouy].*e$/ /[aeiou][^aeiouy].*e/ not /[^aeiou][aeiouy][^aeiouwxy]e$/
Truth table100%4/4
A or B and not(C)
A= /[^aeiou][aeiouy].*[^aeiou][aeiouy].*e$/B= /[aeiou][^aeiouy].*e/C= not /[^aeiou][aeiouy][^aeiouwxy]e$/
ABCresult
1XX1
0111
00X0
0100
84 ( /[aeiou][^aeiouy].*e/ && ! /[^aeiou][aeiouy][^aeiouwxy]e$/) );
85  
86 # step5b_rules
87 #DEBUG warn("step 5b: $_\n") &&
88 674 ▶ s/ll$/l/ if /[^aeiou][aeiouy].*[^aeiou][aeiouy].*ll$/;
Branch: 1 branch
BranchTrueFalseTotal
if /[^aeiou][aeiouy].*[^aeiou][aeiouy].*ll$/ 1 673 674
89  
90 # Cosmetic step
91 674 s/(.)i$/$1y/;
92 }
93 680 @parms;
94 }
95  
96 2 1;
97  
98 __END__
« perlindex ↑ Summary