son-logic-engine 0.2.4__tar.gz → 0.2.5__tar.gz

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.
@@ -259,7 +259,7 @@ checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90"
259
259
 
260
260
  [[package]]
261
261
  name = "son_logic_engine"
262
- version = "0.2.4"
262
+ version = "0.2.5"
263
263
  dependencies = [
264
264
  "pyo3",
265
265
  "serde",
@@ -1,7 +1,7 @@
1
1
 
2
2
  [package]
3
3
  name = "son_logic_engine"
4
- version = "0.2.4" # Tạm thời để 0.2.3, sẽ được cập nhật lên 0.2.4
4
+ version = "0.2.5" # Cập nhật trực tiếp lên 0.2.5
5
5
  edition = "2021"
6
6
  authors = ["Son <sonbuwin@gmail.com>"]
7
7
  readme = "README.md"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: son_logic_engine
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: High-performance Rust search engine for RAG systems
5
5
  Author-email: Son <sonbuwin@gmail.com>
6
6
  Requires-Python: >=3.7
@@ -37,11 +37,28 @@ The core search function. Returns a list of records (as JSON strings) ranked by
37
37
  - `mapping`: The mapping object from `load_mapping`.
38
38
  - `field_name`: (Optional) The specific key in your dictionary to search within.
39
39
 
40
- ### 3. `print(raw_results: list)`
41
- A utility function to decode and pretty-print the JSON results returned by `loc`.
40
+ ### Python-side Utility: `slg.print(raw_results: list)`
41
+ This is a *notebook-defined helper function* designed to pretty-print the JSON results returned by `loc` in a readable format within a Python environment. It is not part of the core Rust library distributed via PyPI.
42
+
42
43
  ```python
43
- results = slg.loc("search term", data, mapping)
44
- slg.print(results)
44
+ # Example of how you might define and use a similar helper in Python
45
+ import json
46
+
47
+ def slg_print_helper(raw_results):
48
+ if not raw_results:
49
+ print("Không tìm thấy kết quả nào.")
50
+ return
51
+ for i, item_json in enumerate(raw_results):
52
+ try:
53
+ data_obj = json.loads(item_json)
54
+ print(f"[Hạng {i+1}]")
55
+ print(json.dumps(data_obj, indent=4, ensure_ascii=False))
56
+ print("---" * 10)
57
+ except Exception as e:
58
+ print(f"Lỗi khi giải mã kết quả thứ {i+1}: {e}")
59
+
60
+ # Assuming `slg` is imported and `raw_results` are from `slg.loc`
61
+ # slg_print_helper(raw_results)
45
62
  ```
46
63
 
47
64
  ## 🔒 Security & Contact
@@ -29,11 +29,28 @@ The core search function. Returns a list of records (as JSON strings) ranked by
29
29
  - `mapping`: The mapping object from `load_mapping`.
30
30
  - `field_name`: (Optional) The specific key in your dictionary to search within.
31
31
 
32
- ### 3. `print(raw_results: list)`
33
- A utility function to decode and pretty-print the JSON results returned by `loc`.
32
+ ### Python-side Utility: `slg.print(raw_results: list)`
33
+ This is a *notebook-defined helper function* designed to pretty-print the JSON results returned by `loc` in a readable format within a Python environment. It is not part of the core Rust library distributed via PyPI.
34
+
34
35
  ```python
35
- results = slg.loc("search term", data, mapping)
36
- slg.print(results)
36
+ # Example of how you might define and use a similar helper in Python
37
+ import json
38
+
39
+ def slg_print_helper(raw_results):
40
+ if not raw_results:
41
+ print("Không tìm thấy kết quả nào.")
42
+ return
43
+ for i, item_json in enumerate(raw_results):
44
+ try:
45
+ data_obj = json.loads(item_json)
46
+ print(f"[Hạng {i+1}]")
47
+ print(json.dumps(data_obj, indent=4, ensure_ascii=False))
48
+ print("---" * 10)
49
+ except Exception as e:
50
+ print(f"Lỗi khi giải mã kết quả thứ {i+1}: {e}")
51
+
52
+ # Assuming `slg` is imported and `raw_results` are from `slg.loc`
53
+ # slg_print_helper(raw_results)
37
54
  ```
38
55
 
39
56
  ## 🔒 Security & Contact
@@ -5,7 +5,7 @@ build-backend = "maturin"
5
5
 
6
6
  [project]
7
7
  name = "son_logic_engine"
8
- version = "0.2.4" # Tạm thời để 0.2.3, sẽ được cập nhật lên 0.2.4
8
+ version = "0.2.5" # Cập nhật trực tiếp lên 0.2.5
9
9
  description = "High-performance Rust search engine for RAG systems"
10
10
  authors = [{name = "Son", email = "sonbuwin@gmail.com"}]
11
11
  readme = "README.md"
@@ -1,29 +0,0 @@
1
- {
2
- "a": 0.1,
3
- "b": 0.2,
4
- "c": 0.3,
5
- "d": 0.4,
6
- "e": 0.5,
7
- "f": 0.6,
8
- "g": 0.7,
9
- "h": 0.8,
10
- "i": 0.9,
11
- "j": 1.0,
12
- "k": 1.1,
13
- "l": 1.2,
14
- "m": 1.3,
15
- "n": 1.4,
16
- "o": 1.5,
17
- "p": 1.6,
18
- "q": 1.7,
19
- "r": 1.8,
20
- "s": 1.9,
21
- "t": 2.0,
22
- "u": 2.1,
23
- "v": 2.2,
24
- "w": 2.3,
25
- "x": 2.4,
26
- "y": 2.5,
27
- "z": 2.6,
28
- " ": 0.0
29
- }