473,289 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 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
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 (`?');
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
vocabulary.
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 635

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Michael Teter | last post by:
My web search for future Python-related conferences has turned up nothing. I see plenty about previous conferences, but nothing for the future. Can anyone point me toward some list of...
8
by: Sean | last post by:
System is Redhat 9.0, Python 2.2.3, Zope 2.6.2 built OpenSSL from source: 2791797 Sep 30 14:50:15 2003 openssl-0.9.7c.tar.gz used configure options to set for /usr/local and...
0
by: praba kar | last post by:
Dear All, Can any one guide me how to get python related jobs?. Actually Now I am in Python web programming field. I have technical knowledge about Python, ZOPE and Twisted-web(Twisted...
7
by: Maxwell Hammer | last post by:
Hi all, This is related to an earlier post 'Help with thread related tracebacks'...for which I have had no feedback yet :-( How should a thread complete i.e. how should it exit? Reading the...
4
by: Elmo Mäntynen | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm interested in various metadata extraction/prosessing/distribution/something tools(including ways of differentiating between files, eg hashing...
4
by: Sathyaish | last post by:
My question will sound daft to the good old craftsmen, but they will excuse my nescience on the subject. I come new to the Pythonic world from the land of .NET languages, VB6 and some familiarity...
14
by: ToddLMorgan | last post by:
Summary: How should multiple (related) projects be arranged (structured) and configured so that the following is possible: o Sharing common code (one of the projects would be a "common" project...
4
by: samjnaa | last post by:
Please check for sanity and approve for posting at python-dev. Currently file-directory-related functionality in the Python standard library is scattered among various modules such as shutil, os,...
0
by: Michael Pittaro | last post by:
I've been getting ready for OSCon 2007 next week, and theres quite a bit of Python related activity there. Based on a suggestion from Jeff Rush, (who can't be there), I've proposed a Python...
3
by: Dennis | last post by:
I have a problem that I don't understand at all. I run a python script, which uses pickle, and it fails. That alone is, perhaps, no big deal. The problem that's got me annoyed is that after...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.