Skip to main content

son-logic-engine

High-performance search filter for RAG systems written in Rust, designed for speed and accuracy with Vietnamese text.

🚀 Features

  • Rust Core: Blazing fast processing for large datasets.
  • Polymorphic Input: Supports List[str], Dict, or nested List[Dict].
  • Field Filtering: Optimize search speed by targeting specific columns.
  • Unicode Support: Native handling of Vietnamese characters and custom character mappings.

🛠 Installation

pip install son-logic-engine

📖 API Reference

1. load_mapping(path: str)

Loads the character weight mapping from a JSON file. This is required for the search logic to compute character-based relevance.

import son_logic_engine as slg
mapping = slg.load_mapping('path/to/mapping.json')

2. loc(query: str, database: Any, mapping: dict, field_name: str = None)

The core search function. Returns a list of records (as JSON strings) ranked by relevance to the query.

  • query: The search term.
  • database: Your data (List of strings or List of Dictionaries).
  • mapping: The mapping object from load_mapping.
  • field_name: (Optional) The specific key in your dictionary to search within.

Python-side Utility: slg.print(raw_results: list)

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.

# Example of how you might define and use a similar helper in Python
import json

def slg_print_helper(raw_results):
    if not raw_results:
        print("Không tìm thấy kết quả nào.")
        return
    for i, item_json in enumerate(raw_results):
        try:
            data_obj = json.loads(item_json)
            print(f"[Hạng {i+1}]")
            print(json.dumps(data_obj, indent=4, ensure_ascii=False))
            print("---" * 10)
        except Exception as e:
            print(f"Lỗi khi giải mã kết quả thứ {i+1}: {e}")

# Assuming `slg` is imported and `raw_results` are from `slg.loc`
# slg_print_helper(raw_results)

🔒 Security & Contact

The underlying search algorithm and character weight logic are proprietary. For access to standard mapping files or custom integration, please contact:

📩 Email: sonbuwin@gmail.com

Metadata

Release files for son-logic-engine 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for son-logic-engine 0.2.5
File Size Uploaded Provenance Actions
son_logic_engine-0.2.5.tar.gz 7.1 MB Without provenance Details for son_logic_engine-0.2.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for son-logic-engine 0.2.5
File Interpreter ABI Platform Actions
son_logic_engine-0.2.5-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details for son_logic_engine-0.2.5-cp312-cp312-manylinux_2_34_x86_64.whl

Total release size: 7.4 MB

Release files / son_logic_engine-0.2.5.tar.gz

Download URL son_logic_engine-0.2.5.tar.gz
Size 7.1 MB
Tags Source
SHA-256 checksum
How to use checksums
abbbeb5b0f0508f315a1c5cee8f380be4ef508a7918fd0ca8f625b7f6df01402
BLAKE2b-256 checksum
How to use checksums
4848c3e207cf8226ec81af7b89e49749834e1267bd4df1003093d6005ca47658
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / son_logic_engine-0.2.5-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL son_logic_engine-0.2.5-cp312-cp312-manylinux_2_34_x86_64.whl
Size 317.6 kB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
67de38e91f79ffec9fb7cf32086aad0938842116e0e240c5695c4bc87a01761c
BLAKE2b-256 checksum
How to use checksums
15e827ef339dcfc6d7ea432aa969617a982a4f712384dede526adb0d5513f8f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for son-logic-engine 0.2.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page