Skip to content
 
 

Latest commit

 

History

36 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TextDistance-RS Banner

🦀 TextDistance-RS

Resurrecting the TextDistance Python Library in Rust

🚀 Faster • 🔒 Memory Safe • ⚡ Zero-Cost Abstractions • 🧪 Tested • 📦 Modular


🌟 About the Project

TextDistance-RS is a Rust reimplementation of the popular TextDistance Python library, developed as part of the Code Resurrection Hackathon.

The project revives an established open-source repository by faithfully recreating its functionality in Rust, leveraging the language's performance, memory safety, and modern systems programming capabilities.

Instead of simply translating syntax, the project focuses on preserving algorithmic correctness while adopting idiomatic Rust design principles.


🎯 Project Objective

Our primary objective was to resurrect an existing open-source Python project into Rust while maintaining functional parity and improving maintainability.

We aimed to

✅ Preserve the original algorithm logic

✅ Maintain identical outputs wherever applicable

✅ Utilize Rust's ownership model for memory safety

✅ Build a clean, modular architecture

✅ Improve execution efficiency

✅ Create a scalable foundation for future enhancements


✨ Features

🦀 Pure Rust Implementation

⚡ High Performance Execution

🔒 Memory Safe Architecture

📦 Modular Code Organization

🧩 Easy to Extend

🧪 Unit Tested

📚 Clean Documentation

♻️ Open Source

💻 Cross Platform

🚀 Cargo Based Build System


🛠 Tech Stack


🛠️ Project Structure

textdistance-rs
│
├── src
│   ├── edit.rs
│   ├── lib.rs
│   ├── phonetic.rs
│   ├── sequence.rs
│   ├── simple.rs
│   ├── token.rs
│   ├── traits.rs
│   └── utils.rs
│
├── Cargo.toml
├── Cargo.lock
└── README.md

📂 Module Overview

Module Description
📝 edit.rs Edit distance algorithms
🔤 phonetic.rs Phonetic similarity algorithms
🔠 sequence.rs Sequence comparison algorithms
🧮 simple.rs Basic similarity metrics
🪙 token.rs Token-based algorithms
📚 traits.rs Shared traits and abstractions
🛠 utils.rs Helper utilities
📦 lib.rs Library entry point

⚙️ Getting Started

Clone Repository

git clone https://github.com/darkweb-alt/textdistance-rs.git

cd textdistance-rs

Build Project

cargo build

Run

cargo run

Run Tests

cargo test

🧪 Testing

Every implemented algorithm is validated using Rust's built-in testing framework.

cargo test

Example

running 24 tests

test result: ok.

🏗️ Development Workflow

📂 Analyze Original Python Repository
                 │
                 ▼
📖 Study Algorithm Logic
                 │
                 ▼
🦀 Reimplement in Rust
                 │
                 ▼
🧪 Validate Outputs
                 │
                 ▼
⚡ Optimize Structure
                 │
                 ▼
📚 Document Project

🚀 Why Rust?

🐍 Python 🦀 Rust
Dynamic Typing Static Typing
Interpreter Required Native Binary
Garbage Collection Ownership Model
Runtime Memory Checks Compile-Time Safety
Moderate Performance High Performance
Runtime Errors Safer Code

📊 Highlights

🏆 Developed for the Code Resurrection Hackathon

📦 Modular Architecture

🦀 Idiomatic Rust Codebase

📚 Readable Source Code

🧪 Comprehensive Testing

🚀 High Performance Execution

🔒 Memory Safety

♻️ Open Source


🔮 Future Roadmap

  • 🚀 Complete remaining algorithms

  • 📊 Performance Benchmark Suite

  • 📦 Publish on crates.io

  • 🌍 Unicode Optimizations

  • 🔄 Continuous Integration (CI)

  • 📚 API Documentation

  • ⚡ SIMD Optimizations

  • 🤝 Community Contributions


🤝 Contributing

We welcome contributions from the community!

Steps

🍴 Fork the repository

🌿 Create a feature branch

git checkout -b feature-name

💾 Commit your changes

git commit -m "Added new feature"

📤 Push to GitHub

git push origin feature-name

🎉 Open a Pull Request


👨‍💻 Meet the Team

Pitambar Yadav
Pitambar Yadav
@darkweb-alt
Venkatachalam K
Venkatachalam K
@Venkatachalam17
Mrittika Srinivasan
Mrittika Srinivasan
@Mrittika278
Praveen N
Praveen N
praveen-neshamani

🙏 Acknowledgements

Special thanks to the creators and maintainers of the original TextDistance Python library for making their work available to the open-source community.

Their project served as the inspiration and technical foundation for this Rust implementation.


📜 License

This project is released under the MIT License.

See the LICENSE file for complete details.


⭐ If you found this project useful, consider giving it a Star!

Made with ❤️ in Rust for the Code Resurrection Hackathon

About

Python --> Rust | A Rust reimplementation of the TextDistance Python library, engineered to preserve correctness while leveraging Rust's safety, performance, and maintainability.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages