Skip to content

Filter out parenthesized see phrases - #324

Merged
linearcombination merged 4 commits into
WycliffeAssociates:doc-dev.walink.orgfrom
linearcombination:filter-out-parenthesized-see-phrases
Jul 20, 2026
Merged

Filter out parenthesized see phrases#324
linearcombination merged 4 commits into
WycliffeAssociates:doc-dev.walink.orgfrom
linearcombination:filter-out-parenthesized-see-phrases

Conversation

@linearcombination

Copy link
Copy Markdown
Contributor

By request of PO



SEE_PARENTHETICAL_RE = re.compile(
r"\((?P<prefix_text>[^():]+:)\s*.*?\)",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this regex needs a "[Ss]ee:" in it, or at least a "rc://", or else it's going to match anything parenthetical, like a verse reference, e.g.: (Galatians 5:15)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update addresses regex overreach

Remove any parenthetical string beginning with 'See:'.
Example: '(See: something)' -> ''
"""
return see_parenthetical_re.sub("", source)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend adding some unit tests to demonstrate that this function is behaving as intended. I think it should remove e.g.

  • (See: [[rc://...]])
  • (See: Altar)

but should not remove e.g.:

  • "devour one another (Galatians 5:15)."
  • "precious in his sight (Isaiah 43:4)."
  • "keep provisions (see 2 Chronicles 8:3)."

Of course, PO gets final say.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the test data

Data API changed values returned so test must change to adapt
@linearcombination
linearcombination merged commit 4b880b3 into WycliffeAssociates:doc-dev.walink.org Jul 20, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in DOC Project Management Jul 20, 2026
@linearcombination
linearcombination deleted the filter-out-parenthesized-see-phrases branch July 20, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants