I am working on an application that needs to be able to translate parts of sentences. The problem is that if I send the parts to a translation API like Google Translate, the translations often don't make sense in the context they occurred in. Example:
He leaves the building
If I translate leaves to any destination language I will probably get a result in the context of "leaves of a tree", which of course makes no sense in the example. So, translation needs to keep context into account. If I expand the translation sentence to He leaves I get the correct translation of He leaves. However, I lose the translation of leaves, which is the word I am looking for.
Does anyone have any idea as to how I should approach this? Keep in mind the Google Translate API is a paid API, so I would like to minimize the amount of translations I request from the API.