Is there a fairly simple way for a script to tell (from context) whether “her” is a possessive pronoun?
问题 I am writing a script to reverse all genders in a piece of text, so all gendered words are swapped - "man" is swapped with "woman", "she" is swapped with "he", etc. But there is an ambiguity as to whether "her" should be replaced with "him" or "his". 回答1: Okay. Lets look at this like a linguist might. I am thinking aloud here. "Her" is a pronoun. It can either be a: 1. possessive pronoun This is her book. 2. personal pronoun Give it to her . (after preposition) He wrote her a letter.