in reply to Re: Improving speed match arrays with fuzzy logic
in thread Improving speed match arrays with fuzzy logic

Excellent! Since the worms are well out of the can (and pretty fast too!), can I add s|z, (f|ph) and add a plural case (rather than just making a singular)?

... # $string =~ /^(.+)es$/ && push @patterns, $1; # singular # Bliako modified: ($string =~ /^(.+?)(e?s)$/ && push @patterns, $1) # singular || push @patterns, $string.'(e?s)?' ; s/(?<![sz])(?:s|z)(?=[^\)\.])/(?:s|z)/ for(@patterns); s/f|ph/(:?f|ph)/ for(@patterns); #print "patterns:"; print " /$_/" for(@patterns); print "\n"; # end mods ...

Replies are listed 'Best First'.
Re^3: Improving speed match arrays with fuzzy logic
by tybalt89 (Monsignor) on Jan 19, 2019 at 17:52 UTC

    With a specification of "and so on" you can add anything you want :)