Skip to content

libzim.suggestion

libzim suggestion module

  • SuggestionSearcher to perform a suggestion search over a libzim.reader.Archive

Usage:

archive = Archive(fpath)
suggestion_searcher = SuggestionSearcher(archive)
suggestions = suggestion_searcher.suggest("foo")
for path in suggestion.getResults(10, 10) # get result from 10 to 20 (10 results)
    print(path, archive.get_entry_by_path(path).title)

Classes:

SuggestionSearcher

ZIM Archive SuggestionSearcher.

Parameters:

  • archive (Archive) –

    ZIM Archive to search.

Attributes:

Methods:

  • suggest

    SuggestionSearch object for a query of this SuggestionSearcher's ZIM Archive.

suggest method descriptor

suggest(query: str) -> SuggestionSearch

SuggestionSearch object for a query of this SuggestionSearcher's ZIM Archive.

Returns:

  • SuggestionSearch

    The SuggestionSearcher object for a query of this SuggestionSearcher's ZIM Archive.