Skip to content

Commit

Permalink
Docs: Fix rule-based matching example that expands named entities (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
shadeMe authored and adrianeboyd committed Apr 6, 2023
1 parent 9fbb8ee commit f66d55f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions website/docs/usage/rule-based-matching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,8 @@ def expand_person_entities(doc):
if prev_token.text in ("Dr", "Dr.", "Mr", "Mr.", "Ms", "Ms."):
new_ent = Span(doc, ent.start - 1, ent.end, label=ent.label)
new_ents.append(new_ent)
else:
new_ents.append(ent)
else:
new_ents.append(ent)
doc.ents = new_ents
Expand Down

0 comments on commit f66d55f

Please sign in to comment.