sporky-checker

Crates.iosporky-checker
lib.rssporky-checker
version1.0.1
created_at2024-12-17 16:56:39.811663+00
updated_at2024-12-18 13:01:54.644576+00
descriptionSimple levenshtein spell checker app
homepage
repository
max_upload_size
id1486473
size4,348,384
Spork (SporkyDevelops)

documentation

README

Spork Checker

Rust

A very simple Levenshtein-based spell checker that finds approximate matches for a given word by comparing to a word list. Implemented in rust.

Features

  • Levenshtein Distance: Uses Levenshtein Algorithm to calculate possible matches
  • Customizable output: Verbose and matches options

Crates

  • Clap: Makes CLI argument parsing easier
  • Rust-Embed: Allows building of data folders directly into binary

Installation

Prerequisites

  • Rust installed on your system. You can install it using rustup.

Build and Run

From crates.io:

  • cargo install sporky-checker

From source:

  1. Clone this repository:
git clone https://github.com/SporkyDevelops/Sporky-levenshtein.git
cd Sporky-levenshtein
  1. Build the project:
cargo build --release
  1. Run the application:
cd /target/release/
./spork-checker

Usage

spork-checker [OPTIONS] [TARGET]

Arguments

[TARGET]: The target word to check against the word list.

Options

  • -v, --verbose: Show detailed output, including the Levenshtein distance for each match.
  • -n, --number [NUMBER]: Specify the number of matches to display (default: 5).

Example

Input:

spork-checker ruzt -n 1

Output:

Possible Matches: 
- 'rust'

Word List

The application reads a word list from en.txt. This files is built into the binary, if not specify the path in the read_word_list function.

Equation

(i-1, j) deletion
(i, j-1) insertion
(i-1, j-1) substitution

Matrix Example

Source: Datumorphism Photo source: Datumorphism

Author

Sporky Develops

Commit count: 0

cargo fmt