strict typechecking

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2026-08-16 11:32:47 +02:00
parent f30e6baa67
commit 76941efc7e
44 changed files with 165 additions and 155 deletions
+2 -2
View File
@@ -109,7 +109,7 @@ class Pages:
self.pages.append(page)
self.size = sum(page.size for page in self.pages)
def search(self, text: str, topk: int = 10, full: bool = True) -> list[Page]:
def search(self, text: str, topk: int = 10, full: bool = True) -> list[tuple[float, Page]]:
if not text or len(text) < 2:
return []
if len(self.pages) == 0:
@@ -146,7 +146,7 @@ def get_docs_page(page_title: str) -> str:
return content
def search_html(pages: list[Page]) -> str:
def search_html(pages: list[tuple[float, Page]]) -> str:
html = ''
for score, page in pages:
if score > 0.0: