Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Efficient selective substitution on list of words

by Polyglot (Monk)
on Jan 31, 2010 at 13:56 UTC ( #820578=note: print w/ replies, xml ) Need Help??


in reply to Re: Efficient selective substitution on list of words
in thread Efficient selective substitution on list of words

I really do appreciate your suggestions, and while it may be more detailed overall, the charm of tye's solution was that he basically prepared the entire substitution list in a single line of code, using map, sort, and join with some interesting syntax and I was wanting to learn how it worked for the beauty of learning as much as for the joy of having a working solution.

In the sort process, I remember he ordered the words by length so that the substitutions would start with the longest words and work down to the shorter ones. This would avoid several potential problems with overlapping terms in the exchange list, and is almost a necessity, I think, to proper function here.

Blessings,

~Polyglot~


Comment on Re^2: Efficient selective substitution on list of words

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2014-10-25 08:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (142 votes), past polls