Skip to content

Commit

Permalink
Adding test to ensure regexsearch with partial matches will match a t…
Browse files Browse the repository at this point in the history
…oken at the 0 index
  • Loading branch information
gandersen101 committed Mar 11, 2024
1 parent 01448ee commit 7d3658c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test__search/test_regexsearcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ def test_match_will_expand_on_partial_match_if_partials(
assert matches == [(5, 6, 100)]


def test_match_will_expand_on_partial_match_at_index_0(
searcher: RegexSearcher, nlp: Language
) -> None:
"""It extends partial matches to span boundaries - index 0 bug is fixed."""
doc = nlp("withh something")
matches = searcher.match(doc, "with")
assert matches == [(0, 1, 100)]


def test_match_on_german_combination_words(
searcher: RegexSearcher, nlp: Language
) -> None:
Expand Down

0 comments on commit 7d3658c

Please sign in to comment.