posted 5 years ago
Probably: No.
You have got yourself a very difficult task there. Determining whether the can in “can opener” is a noun or a verb is just as difficult a task as determining whether can in “can open” is a noun or a verb. In fact I think the answer is neither in the latter case; it is an auxiliary verb and its present meaning cannot exist without open following. In fact you should regard both “can opener” and “can open” as phrases. One is a noun comprising two words and the other a verb comprising two words, what the English language people call a phrasal verb. I would suggest you can do several things:-
Find some details about natural language processing, but that is cutting edge research which has taken sixty‑plus years even to get to the level of Google Translate.Simplify your vocabulary and your grammar. Avoid words with two meanings, e.g. bear, can. Restrict yourself to one‑word terms. Restrict yourself to sentences in the form subject→verb→object.Find a book like Mason Brown and Levine Lex and Yacc (O'Reilly) which shows an example using lex to print verb noun etc, but that restricts itself to my simplified vocabulary.