Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Challenge: prefix($x, $y) . suffix($x, $z) eq $x

by Limbic~Region (Chancellor)
on Apr 22, 2009 at 22:28 UTC ( [id://759429]=note: print w/replies, xml ) Need Help??


in reply to Re: Challenge: prefix($x, $y) . suffix($x, $z) eq $x
in thread Challenge: prefix($x, $y) . suffix($x, $z) eq $x

FunkyMonk,
I believe this code is flawed in that it violates two of the rules.
  • The maximum match must be taken.
  • Entire word can not be matched

Changing the players for a dictionary file, I tried 'hello'. It produced the following:

h.ello PREFIX h: ha haberdasher ..... he head
Neither 'he' nor 'head' should be matched here because they share more than just 'h' in common with 'hello'. 'he' should be excluded because it consumes the entire word.

Cheers - L~R

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-03-19 04:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found