Skip to content

Commit

Permalink
Expose SnippetGenerator.set_max_num_chars() so changing the default i…
Browse files Browse the repository at this point in the history
…s possible (#323)

Co-authored-by: Erlend Simonsen <erlend.simonsen@gmail.com>
  • Loading branch information
Fudge and Erlend Simonsen authored Aug 8, 2024
1 parent 4df19aa commit bb17328
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/snippet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,8 @@ impl SnippetGenerator {
let result = self.inner.snippet(&text);
Snippet { inner: result }
}

pub fn set_max_num_chars(&mut self, max_num_chars: usize) {
self.inner.set_max_num_chars(max_num_chars);
}
}
3 changes: 3 additions & 0 deletions tantivy/tantivy.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -433,3 +433,6 @@ class SnippetGenerator:

def snippet_from_doc(self, doc: Document) -> Snippet:
pass

def set_max_num_chars(self, max_num_chars: int) -> None:
pass

0 comments on commit bb17328

Please sign in to comment.