473,503 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 642

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

Similar topics

2
1404
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
2197
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
988
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
1775
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
1154
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
1544
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
1555
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
1408
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
890
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
837
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...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7322
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6982
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5572
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4667
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3161
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.