473,656 Members | 2,983 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**********@y ahoo.co.inwrote :
develop a function called standardise_phr ase 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 651

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

Similar topics

2
1411
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 conferences? I'm looking for Python, possibly Zope, possibly Plone, and even other modern web and system development topics. Thanks, Michael
8
2207
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 /usr/local/openssl make make test make install
0
997
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 Python) with 1 year exp..
7
1782
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 python online docs one gets the idea that simply returning is OK - but I'm not sure. Is it ok to do a sys.ext()? Use 'return' or just let them run out with no 'return' ???
4
1159
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 etc) and especially python enabled ones. I'm also considering content-recognition/differentiating eg. image recognition. I'm already aware of these: python-bitzi, python-musicbrainz, mmpython, IMDbPY, python-mhash and imgSeek. If you could point...
4
1553
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 in C and C++. I just read about wxWindows last night. From my understanding, it is a GUI framework like MFC that lets you create UI apps with ease calling a standard set of API accross multiple platforms (unlike MFC) and if the Windows port is...
14
1565
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 referenced by all others and likely the others would share at least the common project and possibly more as times goes on) o Clear separation of "production" code and "test" code (ie to readily ship source and test as separate components. Usually...
4
1418
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, dircache etc. So I request that the functions be gathered and consolidated at one place. Some may need renaming to avoid conflicts or for clarification.
0
901
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 Advocacy BoF on Monday, from 6:30pm - 7:30pm. For anyone arriving early, this will be a great opportunity to coordinate Python advocacy activites at OSCon. Theres also a regular Python BoF on Wednesday from 8:30pm - 9:30pm.
3
842
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 getting said error I close the shell window, open a new one, run the python interpreter and type "import pickle" and get the error that the script I'd run earlier caused. Why is this ? To my knowledge, once python stopped running it didn't store...
0
8380
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8296
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8710
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8497
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8598
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7310
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4150
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2721
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.