Skip to content

Commit

Permalink
Fix #870 - allow to handle 1st/2nd person pronouns
Browse files Browse the repository at this point in the history
  • Loading branch information
nonprofittechy committed Aug 1, 2024
1 parent b415c18 commit 9460675
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion docassemble/AssemblyLine/al_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,12 @@ def pronoun(self, **kwargs) -> str:
Returns:
str: The appropriate pronoun.
"""
# Developers can do funky things; be a little flexible
person = str(kwargs.get("person", self.get_point_of_view()))

if person in ("1", "1p", "2", "2p"):
# Use the parent version of pronoun
return super().pronoun(**kwargs)

if hasattr(self, "pronouns") and isinstance(self.pronouns, str):
pronouns = DADict(elements={self.pronouns.lower(): True})
else:
Expand Down Expand Up @@ -1650,6 +1655,12 @@ def pronoun_possessive(self, target, **kwargs) -> str:
Returns:
str: The appropriate possessive phrase.
"""
person = str(kwargs.get("person", self.get_point_of_view()))

if person in ("1", "1p", "2", "2p"):
# Use the parent version of pronoun
return super().pronoun_possessive(target, **kwargs)

if hasattr(self, "pronouns") and isinstance(self.pronouns, str):
pronouns = DADict(elements={self.pronouns.lower(): True})
else:
Expand Down Expand Up @@ -1716,6 +1727,12 @@ def pronoun_subjective(self, **kwargs) -> str:
Returns:
str: The appropriate subjective pronoun.
"""
person = str(kwargs.get("person", self.get_point_of_view()))

if person in ("1", "1p", "2", "2p"):
# Use the parent version of pronoun
return super().pronoun_subjective(**kwargs)

if hasattr(self, "pronouns") and isinstance(self.pronouns, str):
pronouns = DADict(elements={self.pronouns.lower(): True})
else:
Expand Down

0 comments on commit 9460675

Please sign in to comment.