Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Improving speed match arrays with fuzzy logic

by bliako (Monsignor)
on Jan 19, 2019 at 16:55 UTC ( [id://1228749]=note: print w/replies, xml ) Need Help??


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 :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1228749]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-25 12:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found