The iLexicon system can handle active/passive voice conversion of fairly complex English sentences. I gave examples of the underlying verb conjugation mechanism in this article and this one. Today, I am going to give examples of the conversion of complete sentences.
Here is an example of active to passive voice conversion:
The above is a snapshot of the interactive session in my Sicstus Prolog IDE. You can see that the sentence “he drank milk” has been correctly converted to “milk was drunk by him”.
Here are some more examples of active to passive voice conversion:
The last example is a special case that uses the preposition “to” instead of “by” in the passive voice.
What about passive voice to active voice? The following is based on the earlier example:
It works as expected. Here are some more conversions:
Notice how the pronouns in the first example are suitably modified while changing the voice. The last example is a special case where the subject is missing. The word “someone” is introduced in this case when converting to active voice.
Instead of converting from one voice to the other, we can give an active voice sentence and a passive voice sentence and check if they agree.
Note that the system flags the second example as incorrect. The correct conversion of the active voice sentence “he drank the sweet milk” is “the sweet milk was drunk by him“.
Here are more examples of this:
As you would have guessed, the first example shows incorrect conversion. The correct conversion is “the story book is being read by peter“.
iLexicon’s conversion engine first parses the given sentence to extract the Subject, Predicate and Object. Then it applies verb conjugation and active/passive conversion rules, and finally emits the transformed structure. Below is a snapshot of the core logic (Prolog):
It was challenging to work on this part but I thoroughly enjoyed it!
Have a great weekend!
Recent Comments