On Wed, May 21, 2008 at 10:34 PM, salil_reeves <sa**********@yahoo.co.inwrote:
develop a function called standardise_phrase to convertI think a question similar to this was answered on the list today or
the user's input to a standard form for subsequent processing. This
involves:
1. removing all inter-word punctuation, which for our purposes is
assumed to
consist only of commas (`,'), full stops (`.'), exclamation marks
(`!') or
question marks (`?');
yesterday, for removing spaces and hyphens.
2. stripping away any leading and trailing blank spaces; andIf your solution for part 1 can't be extended to cover this... you
might have to find another way to "strip" the the spaces ;)
3. replacing words in the user's input with ELIZA's preferredAssuming you have some sort of dictionary mapping words to ELIZA
vocabulary.
words, you should be able to iterate through all of the words in the
input and, using that dictionary, swap the key for the value in your
input string.
There, I think those are sufficiently vague as to not do your homework
for you, but maybe get you started...