Metadata-Version: 2.1
Name: curly_comparer
Version: 0.1.1
Summary: A little package with string comparison tools
Author-email: Pedro Lopez Guzman <pdihax@gmail.com>
License: Apache License 2.0
Project-URL: Homepage, https://github.com/Pedro-UwU/curly-comparer
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=2.1
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: numpy; extra == "dev"

# Curly Comparer

A lightweight Python package for advanced string comparison and distance calculation.

## Overview

`curly_comparer` provides flexible string comparison algorithms, primarily focusing on Levenshtein distance calculations with customizable cost functions.

## Features

- **Basic Levenshtein Distance**: Quick string comparison
- **Weighted Levenshtein Distance**: Customizable cost functions for:
  - Character insertions
  - Character deletions
  - Character substitutions

## Installation

Install `curly_comparer` using pip:

```bash
pip install curly_comparer
```

### Requirements

- Python 3.10+
- NumPy 2.1+

## Usage

### Basic Levenshtein Distance

```python
from curly_comparer.algorithms.levenshtein import distace

# Calculate distance between two strings
distance = distace("hello", "hallo")
print(distance)  # Outputs: 1
```

### Weighted Levenshtein Distance

```python
from curly_comparer.algorithms.levenshtein import weighted_distance

# Custom cost functions
def custom_insertion_cost(char):
    return 1.5  # Different cost for inserting characters

def custom_substitution_cost(char1, char2):
    return 2.0  # Custom substitution cost

distance = weighted_distance(
    "hello", 
    "hallo", 
    insertion_fn=custom_insertion_cost,
    deletion_fn=lambda x: 1.0,
    subs_fn=custom_substitution_cost
)
```

## Advanced Customization

The `weighted_distance` function allows complete flexibility in defining costs for string transformations:

- `insertion_fn`: Cost of inserting a character
- `deletion_fn`: Cost of deleting a character
- `subs_fn`: Cost of substituting one character for another

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

Licensed under the Apache License 2.0

## Author

Pedro Lopez (pdihax@gmail.com)
