471,873 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,873 software developers and data experts.

Re: related to python

This looks like a homework assignment, but...

On Wed, May 21, 2008 at 10:34 PM, salil_reeves <sa**********@yahoo.co.inwrote:
develop a function called standardise_phrase to convert
the user's input to a standard form for subsequent processing. This
1. removing all inter-word punctuation, which for our purposes is
assumed to
consist only of commas (`,'), full stops (`.'), exclamation marks
(`!') or
question marks (`?');
I think a question similar to this was answered on the list today or
yesterday, for removing spaces and hyphens.
2. stripping away any leading and trailing blank spaces; and
If 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 preferred
Assuming you have some sort of dictionary mapping words to ELIZA
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...
Jun 27 '08 #1
0 607

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Michael Teter | last post: by
reply views Thread by praba kar | last post: by
4 posts views Thread by Elmo Mäntynen | last post: by
4 posts views Thread by Sathyaish | last post: by
reply views Thread by Michael Pittaro | last post: by
3 posts views Thread by Dennis | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.