I use OpenNLP's coreference package for anaphora resolution. So basically I have this input string:
"Harry writes a letter to his brother. He told him that he met Mary in London. They had a lunch together.";
The set of mentions output are as below:
Harry, his, He, him, he, They
I need to replace the pronouns with its proper nouns. I wrote a simple algorithm for this by adding each mention into a list, then iterate the list while replacing each pronouns with the 1st mention ("Harry"). My problem is "his" will be "Harry" not "Harry's".
There aren't a lot of examples/tutorials on pronoun resolver. I have looked through the OpenNLP API. Either I'm looking in the wrong direction or there is one in the API but I don't know how to use it. Can someone please guide me in the right direction to pronoun resolving or give an example of how to do this? Maybe there's a better way that I didn't know of.