biblicus 1.1.1__py3-none-any.whl → 1.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
biblicus/__init__.py CHANGED
@@ -47,4 +47,4 @@ __all__ = [
47
47
  "RetrievalSnapshot",
48
48
  ]
49
49
 
50
- __version__ = "1.1.1"
50
+ __version__ = "1.1.2"
@@ -4,6 +4,7 @@ SQLite full-text search version five retriever for Biblicus.
4
4
 
5
5
  from __future__ import annotations
6
6
 
7
+ import re
7
8
  import sqlite3
8
9
  from pathlib import Path
9
10
  from typing import Dict, Iterable, List, Optional, Set, Tuple, Union
@@ -293,7 +294,9 @@ def _tokenize_query(query_text: str) -> List[str]:
293
294
  :return: Token list.
294
295
  :rtype: list[str]
295
296
  """
296
- return [token for token in query_text.lower().split() if token]
297
+ tokens = [token for token in query_text.lower().split() if token]
298
+ stripped = [re.sub(r"^[\W_]+|[\W_]+$", "", t) for t in tokens]
299
+ return [t for t in stripped if t]
297
300
 
298
301
 
299
302
  def _resolve_stop_words(value: Optional[Union[str, List[str]]]) -> Set[str]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: biblicus
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: Command line interface and Python library for corpus ingestion, retrieval, and evaluation.
5
5
  License: MIT
6
6
  Requires-Python: >=3.9
@@ -1,4 +1,4 @@
1
- biblicus/__init__.py,sha256=KGQ2mjQRe9i8OyE25LZHJAG5jg_fDKOiWMTOprp-NPc,1013
1
+ biblicus/__init__.py,sha256=2Wi69JPJ2_KPCq4hbQ291scrT8XjCEr82gjnqf-pDLQ,1013
2
2
  biblicus/__main__.py,sha256=ipfkUoTlocVnrQDM69C7TeBqQxmHVeiWMRaT3G9rtnk,117
3
3
  biblicus/chunking.py,sha256=GdJr0skAAI0Su99mr7dXqCgR7eJ0sJu8n2XesVGyddY,13206
4
4
  biblicus/cli.py,sha256=GN7L0-s0k9tAj_lthvBrJlfo_DG9y53vYc6k_IhSea0,45797
@@ -71,7 +71,7 @@ biblicus/retrievers/embedding_index_file.py,sha256=mvtXqRX-_eQpi9bRxQ2yqFxY26YhP
71
71
  biblicus/retrievers/embedding_index_inmemory.py,sha256=8csrdjCGkkR7DgvmLZ72oD1gm4duWWUnxJsjw6nLicU,10525
72
72
  biblicus/retrievers/hybrid.py,sha256=kaH-kIi4wxYyUWnKNFT7UNBbHFkRtcGlwjjiJpx-TJY,11789
73
73
  biblicus/retrievers/scan.py,sha256=ccDGVnqBS9a2ymKeBEXdfJz8XLahsBeYWYyYXQcg2KQ,13147
74
- biblicus/retrievers/sqlite_full_text_search.py,sha256=7rzYfzpRhPbsKuXjXi8x2-rmq8-z1em3amUF9UPAomI,25392
74
+ biblicus/retrievers/sqlite_full_text_search.py,sha256=LkUk4yK5b7mXondewi4Y-2MRD1c1XIXcKgKXGAVhpfg,25509
75
75
  biblicus/retrievers/tf_vector.py,sha256=rkcRG1GU5S_3t8GRbQTBThITj-eHT5fs1dyVzXPLg8w,15776
76
76
  biblicus/text/__init__.py,sha256=MiaGAY7xWlUCeBzDzNz6pJnSMiU_Ge5EmlSiEzhqTRo,947
77
77
  biblicus/text/annotate.py,sha256=asmpj3_s_t8hl6stEg99apmqxAhDTkoPzHhZNggYE3Y,8355
@@ -83,9 +83,9 @@ biblicus/text/prompts.py,sha256=9dx1cWpJb6oBY4AhDHxlkRUYs7DfbySH0gb-uBTNvtk,7567
83
83
  biblicus/text/redact.py,sha256=tkDRmA0VvOZwMryEmBPLEHf3Z6VHJkkaWjBaNIMyGZ0,8415
84
84
  biblicus/text/slice.py,sha256=dlHxGO8c5P8BszXGwlNQoQ-cyWjJf6PfS1LUBJXXGEE,5762
85
85
  biblicus/text/tool_loop.py,sha256=dFeIEcCUA-yR8GMqsJ_n4007fHVmn9zK2hhlm6NlWyg,14161
86
- biblicus-1.1.1.dist-info/licenses/LICENSE,sha256=lw44GXFG_Q0fS8m5VoEvv_xtdBXK26pBcbSPUCXee_Q,1078
87
- biblicus-1.1.1.dist-info/METADATA,sha256=WtfRn0ON4GjFGAHca6TFcjt-tpdMUGz5uOR4-ePJ_ys,31202
88
- biblicus-1.1.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
89
- biblicus-1.1.1.dist-info/entry_points.txt,sha256=BZmO4H8Uz00fyi1RAFryOCGfZgX7eHWkY2NE-G54U5A,47
90
- biblicus-1.1.1.dist-info/top_level.txt,sha256=sUD_XVZwDxZ29-FBv1MknTGh4mgDXznGuP28KJY_WKc,9
91
- biblicus-1.1.1.dist-info/RECORD,,
86
+ biblicus-1.1.2.dist-info/licenses/LICENSE,sha256=lw44GXFG_Q0fS8m5VoEvv_xtdBXK26pBcbSPUCXee_Q,1078
87
+ biblicus-1.1.2.dist-info/METADATA,sha256=3cc3juzrrWPJjTG5zlg_MTzwy3fgZ7R65DVXhRAIbPQ,31202
88
+ biblicus-1.1.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
89
+ biblicus-1.1.2.dist-info/entry_points.txt,sha256=BZmO4H8Uz00fyi1RAFryOCGfZgX7eHWkY2NE-G54U5A,47
90
+ biblicus-1.1.2.dist-info/top_level.txt,sha256=sUD_XVZwDxZ29-FBv1MknTGh4mgDXznGuP28KJY_WKc,9
91
+ biblicus-1.1.2.dist-info/RECORD,,