Re: Abstract Text Example and Question

2011-02-10 Thread Matt Neuburg
On Wed, 9 Feb 2011 22:04:58 -0500, Brad Stone cocoa-...@softraph.com said: I made this code to remove any duplicate words from a large group of text. if ([resultArray indexOfObject:s] == NSNotFound) There's the problem. Who knows how this is implemented? You could be searching the entire array

Re: Abstract Text Example and Question

2011-02-10 Thread Brad Stone
Matt and Graham - I knew there was a better approach. I'll look into the things you suggest. On Feb 10, 2011, at 10:19 AM, Matt Neuburg wrote: On Wed, 9 Feb 2011 22:04:58 -0500, Brad Stone cocoa-...@softraph.com said: I made this code to remove any duplicate words from a large group of text.

Abstract Text Example and Question

2011-02-09 Thread Brad Stone
I made this code to remove any duplicate words from a large group of text. The result is stored in an index file so the text doesn't need to make sense. I'm removing the duplicates to save space in the index file. I was wondering if anyone had a suggestion for a more efficient way to

Re: Abstract Text Example and Question

2011-02-09 Thread Graham Cox
Using LZW or similar compression is likely to give you substantially better file compression, if that's what you're after. Of course you'd have to re-expand it to use it. The killer here I would guess is the use of [NSArray indexOfObject:] - it has to perform a string-by-string linear search