I am using Tenseflow's change_tense method to change a present tense to past tense.
But verbs within double quotes are getting changed. They should remain the same.
Example:
- Input: Robin will say “help” to Alexa when he encounters a problem
- Output: Robin said “helped” to Alexa when he encountered a problem
Here "help" should not be changed.
My code:
import tenseflow
def get(self, request):
response = {}
sentance = request.data.get("sentance")
if sentance:
result = tenseflow.change_tense(sentance, "past")
response["status_code"] = 200
if result:
response["past_tense"] = result
return Response(response)
Any suggestion is highly appreciated, thanks!
This my initial solution, I guess this is not the optimal way, but it solves the problem, any comment is welcome, Thanks!