From: James Edward Gray II Date: 2006-04-27T21:51:48+09:00 Subject: Re: [SUMMARY] Text Munger (#76) On Apr 27, 2006, at 7:41 AM, dblack@wobblini.net wrote: > Hi -- > > On Thu, 27 Apr 2006, Ruby Quiz wrote: > >> It's important to remember that this is the Regular Expression >> definition of >> "words", including digit characters and the underscore. That's >> not a perfect >> match for the quiz task, but was a popular choice nonetheless. >> >> Now, I did say *all* words are scrambled and that is what I >> meant. A run of >> four or more punctuation characters is a word, and the middle >> punctuation would >> be scrambled. In practice, this is rare enough to be a minor issue. > > "Are you kiddin'?!" he exclaimed :-) > > I thought some of the solutions addressed these problems, didn't they, > with [^\W\d_] and such? I meant that scrambling long runs of punctuation didn't really seem to be a problem in actual usage. Yes, some did correctly find the right characters to scramble. Worse, I seem to have completely overlooked this gem I was just informed about off-list: On Apr 27, 2006, at 7:36 AM, Stefano Taschini wrote: > On 27/04/06, Ruby Quiz wrote: >> >> We probably can't fix all the solutions like this though. It >> depends on how >> they separated the word into letters. >> >> The downside of this is that it makes it harder to recognize word >> characters, >> without the digits and underscores. Filtering out punctuation is >> a lot harder >> when we expand to such a vast definition of characters. I'm not >> aware of a >> good Ruby solution for that issue yet. (Please enlighten me if >> you are!) > > Actually, my solution [1] does exactly that, with the regexp > String::Letter acting on a string that has been put into D-normal > form. > > > Ciao > Stefano > > > [1] http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/189926 My apologies to those who didn't receive the proper credit. :( James Edward Gray II