[Tutor] Help on python

Alan Gauld alan.gauld at btinternet.com
Mon Apr 15 13:56:10 CEST 2013


On 15/04/13 09:54, Jabesa Daba wrote:
> is it possible to reorder a sentence in the form of SVO (Subject Verb
> Object) into the form of SOV (Subject Object Verb) by using a python
> program? if so, how?

Python is a general purpose programming language so yes, you can program 
it to do any computational task. How much work is involved depends on 
how well you can define the algorithm and whether somebody else has 
already implemented it for you in Python.

In your case you need to consider which language you are processing and 
what the grammatical rules are (what is a word? How do you identify a 
subject, object and verb? What are the separator rules and do you need 
to consider changes of endings etc when you change order? etc)
Just how sophisticated does it need to be?)

There are several libraries that can help ranging from general
purpose text processing and parsers to natural language tookits.
Whatever you use you will still need a fair amount of effort
to get it working. Google (or any other search engine!) is your
friend.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list