Metadata-Version: 2.4
Name: son_logic_engine
Version: 0.2.3
Summary: High-performance Rust search engine for RAG systems
Author-email: Son <sonbuwin@gmail.com>
Requires-Python: >=3.7
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# 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
```bash
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.
```python
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.

### 3. `print(raw_results: list)`
A utility function to decode and pretty-print the JSON results returned by `loc`.
```python
results = slg.loc("search term", data, mapping)
slg.print(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

