| 1 | package Lingua::Stem::UniNE::CS; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use v5.8.1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use utf8; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use parent 'Exporter'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use Unicode::CaseFold qw( fc ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use Unicode::Normalize qw( NFC ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 2 | our $VERSION = '0.08'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 2 | our @EXPORT_OK = qw( stem stem_cs stem_aggressive stem_cs_aggressive ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 2 | *stem_cs = \&stem; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 2 | *stem_cs_aggressive = \&stem_aggressive; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 78 | ▶ | sub stem { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
stem: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 78 | my ($word) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 78 | $word = NFC fc $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 78 | $word = remove_case($word); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 78 | $word = remove_possessive($word); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 78 | return $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 5 | ▶ | sub stem_aggressive { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
stem_aggressive: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 5 | my ($word) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 5 | $word = NFC fc $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 5 | $word = remove_case($word); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 5 | $word = remove_possessive($word); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 5 | $word = remove_comparative($word); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 5 | $word = remove_diminutive($word); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 5 | $word = remove_augmentative($word); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 5 | $word = remove_derivational($word); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 5 | return $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | # remove grammatical case endings from nouns and adjectives | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 83 | ▶ | sub remove_case { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
remove_case: called CC=15 SCAR=27.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 83 | my ($word) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 83 | my $length = length $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 83 | ▶ | if ($length > 7) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 8 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | if $word =~ s{ atech $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 82 | ▶ | if ($length > 6) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 22 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | if $word =~ s{ atům $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 21 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | if $word =~ s{ (?<= ě ) tem $}{}x; # -ětem → -ě | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 80 | ▶ | if ($length > 5) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 43 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | if $word =~ s{ (?: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | ými # -ými | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | | am[ai] # -ama -ami | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | | at[ay] # -ata -aty | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | | ov[éi] # -ové -ovi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | | [áý]ch # -ách -ých | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | ) $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 34 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | if $word =~ s{ (?: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | (?<= [eě] ) t[ei] # -ete -eti -ěte -ěti → -e -ě | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | | (?<= [éi] ) mu # -ému -imu → -é -i | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | | (?<= [eií] ) ch # -ech -ich -ích → -e -i -í | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | | (?<= [eěí] ) mi # -emi -ěmi -ími → -e -ě -í | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | | (?<= [éií] ) ho # -ého -iho -ího → -é -i -í | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | ) $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 56 | ▶ | if ($length > 4) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 39 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | if $word =~ s{ (?: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | at # -at | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | | mi # -mi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | | us # -us | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | | o[su] # -os -ou | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | | [áůý]m # -ám -ům -ým | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | ) $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 30 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | if $word =~ s{ (?: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | es # -es | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | | [éí]m # -ém -ím | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | | (?<= e ) m # -em → -e | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | ) $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 40 | ▶ | if ($length > 3) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 38 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | if $word =~ s{ [aáéouůyý] $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 27 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | if $word =~ m{ [eěií] $}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 4 | return $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | # remove possesive endings from names | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 83 | ▶ | sub remove_possessive { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
remove_possessive: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 83 | my ($word) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 83 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | if length $word < 6; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 9 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | if $word =~ s{ [oů]v $}{}x; # -ov -ův | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 7 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | if $word =~ s{ (?<= i ) n $}{}x; # -in → -i | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 6 | return $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 5 | ▶ | sub remove_comparative { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
remove_comparative: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 5 | my ($word) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 5 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | if length $word < 6; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 1 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | if $word =~ s{ (?<= [eě] ) jš $}{}x; # -ejš -ějš → -e -ě | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 1 | return $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 5 | ▶ | sub remove_diminutive { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
remove_diminutive: called CC=14 SCAR=32.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 5 | my ($word) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 5 | my $length = length $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 5 | ▶ | if ($length > 7) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | if $word =~ s{ oušek $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 5 | ▶ | if ($length > 6) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | # -aček -áček -anek -ánek -oček -onek -uček -unek | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | if $word =~ s{ [aáou][čn]ek $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | # -eček -éček -enek -ének -iček -íček -inek -ínek → -e -é -i -í | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | if $word =~ s{ (?<= [eéií] ) [čn]ek $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 5 | ▶ | if ($length > 5) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | # -ačk -áčk -ank -ánk -átk -očk -onk -učk -unk -ušk | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 1 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | if $word =~ s{ (?: [aáou][čn] | át | uš ) k $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | # -ečk -éčk -enk -énk -ičk -íčk -ink -ínk | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 1 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | if $word =~ s{ [eéií][čn]k $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 5 | ▶ | if ($length > 4) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | # -ak -ák -ok -uk → -a -á -o -u | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 1 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | if $word =~ s{ (?<= [aáou] ) k $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | # -ek -ék -ik -ík → -e -é -i -í | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 1 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | if $word =~ s{ (?<= [eéií] ) k $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 5 | ▶ | if ($length > 3) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 2 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | if $word =~ s{ k $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 5 | return $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 5 | ▶ | sub remove_augmentative { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
remove_augmentative: called CC=7 SCAR=21.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 5 | my ($word) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 5 | my $length = length $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 5 | ▶ | if ($length > 6) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | if $word =~ s{ ajzn $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 5 | ▶ | if ($length > 5) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 1 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | if $word =~ s{ (?<= i ) (?: sk | zn ) $}{}x; # -isk -izn → -i | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 5 | ▶ | if ($length > 4) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 1 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | if $word =~ s{ ák $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 5 | return $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 5 | ▶ | sub remove_derivational { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
remove_derivational: called CC=22 SCAR=40.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 5 | my ($word) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 5 | my $length = length $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 5 | ▶ | if ($length > 8) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | if $word =~ s{ obinec $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 5 | ▶ | if ($length > 7) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | # -ovisk -ovišt -ovník -ovstv | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | if $word =~ s{ ov (?: isk | išt | ník | stv ) $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | # -ionář → -i | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | if $word =~ s{ (?<= i ) onář $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 5 | ▶ | if ($length > 6) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 0 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | if $word =~ s{ (?: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | ásek | loun | nost | štin | teln | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | ov (?: ec | ík | in | tv ) # -ovec -ovík -ovin -ovtv | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | ) $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | # -enic -inec -itel → -e -i | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 0 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | if $word =~ s{ (?: (?<= e ) nic | (?<= i ) (?: nec | tel ) ) $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 5 | ▶ | if ($length > 5) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 1 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | if $word =~ s{ árn $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 1 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | if $word =~ s{ (?<= ě ) nk $}{}x; # -ěnk → -ě | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | # -ián -isk -ist -išt -itb → -i -í | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 1 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | if $word =~ s{ (?<= i ) (?: án | sk | st | št | tb ) $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | # -írn → -í | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 1 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | if $word =~ s{ (?<= í ) rn $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | # -och -ost -oun -ouš -out -ovn | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 1 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | if $word =~ s{ o (?: ch | st | un | uš | ut | vn ) $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 1 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | if $word =~ s{ (?: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | čan | ctv | kář | kyn | néř | ník | stv | ušk | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | ) $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 5 | ▶ | if ($length > 4) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | # -ač -áč -an -án -ář -as | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 1 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | if $word =~ s{ (?: a[čns] | á[čnř] ) $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | # -ec -en -ěn -éř -ic -in -it -iv -ín -íř → -e -ě -é -i -í | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 1 | ▶ | return palatalize($word) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | if $word =~ s{ (?: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | (?<= e ) [cn] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | | (?<= ě ) n | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | | (?<= é ) ř | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | | (?<= i ) [cntv] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | | (?<= í ) [nř] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | ) $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | # -čk -čn -dl -nk -ob -oň -ot -ov -tk -tv -ul -vk -yn | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 1 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | if $word =~ s{ (?: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | č[kn] | o[bňtv] | t[kv] | [du]l | [nv]k | yn | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | ) $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 5 | ▶ | if ($length > 3) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 2 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | if $word =~ s{ [cčklnt] $}{}x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 4 | return $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 49 | ▶ | sub palatalize { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
palatalize: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 49 | my ($word) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 49 | ▶ | return $word | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%9/9
$word =~ s/ \x{10d}t[\x{11b}i\355] $/ck/x or $word =~ s/ \x{161}t[\x{11b}i\355] $/sk/x or $word =~ s/ [c\x{10d}][ei] $/k/x or $word =~ s/ [z\x{17e}][ei] $/h/x
$word =~ s/ \x{10d}t[\x{11b}i\355] $/ck/x or $word =~ s/ \x{161}t[\x{11b}i\355] $/sk/x or $word =~ s/ [c\x{10d}][ei] $/k/x
$word =~ s/ \x{10d}t[\x{11b}i\355] $/ck/x or $word =~ s/ \x{161}t[\x{11b}i\355] $/sk/x
MC/DC100%4/4
$word =~ s/ \x{10d}t[\x{11b}i\355] $/ck/x or $word =~ s/ \x{161}t[\x{11b}i\355] $/sk/x or $word =~ s/ [c\x{10d}][ei] $/k/x or $word =~ s/ [z\x{17e}][ei] $/h/x
$word =~ s/ \x{10d}t[\x{11b}i\355] $/ck/x
$word =~ s/ \x{161}t[\x{11b}i\355] $/sk/x
$word =~ s/ [c\x{10d}][ei] $/k/x
$word =~ s/ [z\x{17e}][ei] $/h/x
Truth table100%5/5
A or B or C or D
A= $word =~ s/ \x{10d}t[\x{11b}i\355] $/ck/xB= $word =~ s/ \x{161}t[\x{11b}i\355] $/sk/xC= $word =~ s/ [c\x{10d}][ei] $/k/xD= $word =~ s/ [z\x{17e}][ei] $/h/x
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | if $word =~ s{ čt[ěií] $}{ck}x # -čtě -čti -čtí → -ck | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | || $word =~ s{ št[ěií] $}{sk}x # -ště -šti -ští → -sk | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | || $word =~ s{ [cč][ei] $}{k}x # -ce -ci -če -či → -k | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | || $word =~ s{ [zž][ei] $}{h}x; # -ze -zi -že -ži → -h | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 30 | chop $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 30 | return $word; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||