From: "DougF" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Sunday, May 16, 2004 2:52 PM
Subject: Re: Strip multiple words from string
> Part of the difficulty is describing the problem... sometimes
> the description evolves as unanticipated results materialize.
Sometimes. But it's seldom that you'll find a solution to a problem that
you're unable to define.
> Better description of problem:
> Assemble a number of different strings with the final result
> being a single string of words and phases that are delimited
> by commas. Strip out duplicate words or phases in the result.
Just consider that there may be a big difference in the algorithm and the
processing time between the two approaches of a) stripping duplicates and
b) not adding duplicates to the assembled string in the first place.
> Singular words are allowed in the phrases. Could not the comma
> be used to distinguish between words and phrases?
In the original material? No. In the final list a comma is as good a
delimiter as any.
What are you calling a phrase? Check out the types and examples of
English phrases at the link below and note that commas seldom delineate a
phrase.
http://grammar.uoregon.edu/phrases/phrases.html
> Would be difficult to create a dictionary of all words that may
> be in original string.
No doubt. But words are fairly easy to parse - generally anything
delimited by white space or punctuation. Short of creating a parser for
English grammar, though, I'm not sure how you'd pull out phrases.
I you want to call any string of words between punctuation marks a
"phrase", then loop over your original string as a list, but don't include
white space characters among the delimiters.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

