Skip to content

Commit

Permalink
lev: module for computing the levenshtein distance for suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
xNaCly committed Nov 21, 2024
1 parent f9458be commit 90fcd43
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lev.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// distance computes the difference between two strings as the the minimum number of
/// single-character edits (insertions, deletions or substitutions) required to change one word
/// into the other
///
/// see: https://en.wikipedia.org/wiki/Levenshtein_distance
pub fn distance(a: &str, b: &str) -> usize {
todo!("levenshtein_distance");
}
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ use rules::{Config, Disabled, Rule};

/// error does formatting and highlighting for errors
mod error;
/// lev implements the levenshtein distance for all sql keywords, this is used to recommend a keyword based on a misspelled word or any
/// unknown keyword at an arbitrary location in the source statement - mainly used at the start of a new statement
mod lev;
/// lexer converts the input into a stream of token for the parser
mod lexer;
/// lsp implements the language server protocol to provide diagnostics, suggestions and snippets for sql based on the sqleibniz tooling
Expand Down

0 comments on commit 90fcd43

Please sign in to comment.