initial commit

This commit is contained in:
2025-07-13 20:01:05 +02:00
commit 2ea546e037
8 changed files with 3818060 additions and 0 deletions

34
src/main.rs Normal file
View File

@@ -0,0 +1,34 @@
use clap::{Args, Parser, Subcommand};
use text_correction::utils;
#[derive(Parser)]
#[command(name = "german word corrector")]
#[command(version, about, long_about = None)]
#[command(next_line_help = true)]
struct Cli {
#[command(subcommand)]
command: Commands
}
#[derive(Subcommand)]
enum Commands {
CorrectWord(WordArgs)
}
#[derive(Args)]
struct WordArgs {
#[arg(short,long)]
input: String,
list_path: String
}
fn main() {
let cli: Cli = Cli::parse();
match &cli.command {
Commands::CorrectWord(args) => {
let out: String = utils::correct(args.input.clone(), args.list_path.clone());
println!("{}", out);
}
}
}