On 2007-08-04, at 16:16:50, Ed Stockly wrote:
Can you duplicate the Tcl output in AppleScript or not is the question.
Well, at this point the challenge becomes becomes an arbitrary and unfair exercise.
You've eliminated the portions of the challenge where AppleScript performs best and limited it to the portions where shell scripting performs best.
Ed,
I've done nothing of the sort. What I did was eliminate the UI portions of the script so as to make for a more convenient test circumstance. In a previous post you stated that you started the timer after the (choose file) call. You must know that both the Tcl and Perl scripts are capable of calling (choose file) and starting a timer afterwards as well as opening the output file afterwards.
There were only two legal IBSN-10s in the previous "t" variable I posted. The other two were illegal. One had an extra "z" on the end and the other was embedded in a larger "word" that looked like a bizarre email address.
A good part of my script is dedicated to extracting an ISBN number from mid string because that was in the challenge. I read your challenge word for word, and no where does it say not to include valid ISBN numbers that are in another string. Those are valid numbers and deserve to be included.
You've simply got to wake up Ed. What you didn't do was pick up on the fact that the challenge was in the context of this thread. Here is a portion of the text variable I supplied (which quoted from William's post) and that _you_ used in your script:
"I'm looking for 10 digit ISBNs in the block of text (which should always be 13 characters--10 digits divided ISBN: 0-596-00053-7 into 4 substrings by 3 hyphens)."
These are things that happen in the real word, data isn't always neat and tidy. AppleScript can do it. Shell scripting should be able to as well.
It's not a problem for the other scripts to match ISBN-13. It's simply the fact that it's implicitly not in the specification to do so.
I won't proceed with this until your script finds those numbers. (I'm on vacation and don't have the time now anyway)
Which one?
As far as I'm concerned, I've met your challenge.
Previously you griped about gentlemanly conduct. I'd like to remind you that the phrase is: "A gentleman and a scholar".
For the first part, being a gentleman, I think it would behoove a certain Ed Stockly to cede the point regarding the goal not including ISBN-13 matches. Now there is a perl script example where the author had no trouble at all interpreting the goal. In fact he made a few subtle improvements on it.
For the second part, I'd like to see you provide the provable 1000 iteration timing result with the legal HTML (actually XHTML) provided by my AppleScript and Tcl examples and Mark Reed's perl example. You'd be doing this to better my AppleScript example because the execution time of 1000 iteration version is not acceptable.
|