Skip to content

feat(snippet): report range of snippets in original text #2636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

laptou
Copy link

@laptou laptou commented May 9, 2025

For my own project, I needed a version of Snippet that provided absolute offsets within the text. This PR does the following:

  • allows the user to retrieve the absolute offset
  • changes the return value of snippet_from_doc to Option<Snippet> and gets rid of "empty snippets"
  • adds new methods snippets_from_doc and snippets which return all of the relevant snippets, not just the best one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant