|
|
Build a service to count characters, words and paragraphs
Years past I wrote a tome with over 150,000 words. I wanted to know how many UNIQUE WORDS I hand employed in my masterpiece. For instance, of those 150,000 words there are 13,546 'the' words, 17,004 'and' words, 11,098 'for' words, etc., employed. I wrote an AppleScript:
Now what I was ultimately searching for with the script was a unique word count. Of those 150,000+ words inside the tome, a specific number, say 17,453 words were unique. I never got the script to function.
Tomes with unique words under a count of 4096 and the script functions. Above that number and the script will crash. Each unique word has to have its own array …
If I recollect correctly the problem was the default number of arrays in AppleScript. Once the number of unique words counted by the script began to tally past …? 4096 was it? the default size limit of an AppleScript array was compromised and the script crashed. I also gave up working on perfecting the script at this time.
If anyone is up for a challenge, a UniqueWords script, here's one. Think about it: a marker of one's ability to express themselves. A marker of ones command of the english or any language. The number (and information gleaned) is similar to an IQ score at certain K-12 to the adult stages in ones life. (I'd like half of a Nobel Prize winnings should anyone take this idea to the limit. It was MY idea that got you this fame and fortune, mind you … :)
Build a service to count characters, words and paragraphs
What's wrong with "sort -u" to get the unique words and then "wc" to count the actual number - should that not work (once you have each word on a seperate line).
Build a service to count characters, words and paragraphs
Thanks for the quick-thought response but you misunderstood the goal. ---
Someday, Murgatroyd will live …!
Build a service to count characters, words and paragraphs
I am of the belief an AppleScript array was unable hold more than (512 X 8) 4,096 unique numbers. Any larger number of unique words in any tome crashes any AppleScript. It's a software bug with arrays. ---
Someday, Murgatroyd will live …! |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.15 seconds |
|