Suppose I have a text file :

As a manager, he told FIFA TV he communicates his messages in a measured way. “I’m not one of the lads,” Southgate explained.

How do I change the sentence inside the quote (") into indirect sentence? What method/algorithm do I need to use? Can someone give me an example on how?

When I develop an algorithm I do so manually then write done how I got from the beginning to the end. You have your work ahead of you unless you meant to post this as a for-hire piece of work.

Once I sketched out the algorithm then I start thinking about how to implement that in code.
Sometimes I find students try to code first rather than use their head first.

I know the logic, but i dont know how to implement the logic into code @rproffitt

What method/algorithm do I need to use?
or
I know the logic

Which?

commented: Which logic! +15

Not to leave you without more reference. https://www.quora.com/Is-there-is-an-app-to-convert-direct-speech-into-indirect-speech also notes a fine source plus here I see an advert for a NLP (natural language processing) development system that claims you can start building apps in 3 months.

Udacity’s NLP Nanodegree program gets you cutting-edge building apps in just 3 months!

I am encountering newer programmers that tackle problems that require a lot of work. Some burn as they discover this or expected this to be a ready to use function.

Maybe you can take a shortcut to build an app to just deal with your one example?

I know the logic how to change the sentence, but I do not know how to implement those logic into code in python. @JamesCherrill

@Syafiqur, you seem to be dismissing a few things.

First, it's not a small passage of code. NLP is something you study and work on for years. If you have just started you might be under the impression it's something folk can do in just a day or a few hours.

Second you are restricting your implementation to just Python. Not a bad idea since I think this is great for portability.

Finally you say you have the logic so where are you stuck? That is, when converting from your logic that you wrote down, it's hopefully in a step by step process that you take a step and break that down into code.

Where is your written down logic?
Where is your work on any of the steps?

You will find that on bigger tasks you usually never find folk write the code for you but may help with a block but you have to become deeply engaged in the work. So far your posts are leaning towards "Gimme the code to do this."

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.