package mula

  1. Overview
  2. Docs
ML's library for Universal Levenshtein Automata

Install

Dune Dependency

Authors

Maintainers

Sources

mula-0.1.0.tbz
sha256=c781cc1225b311f082a63da6dc10f94a44cdf5568e26ff070a66b62fc1482fe7
sha512=acd41a69b47163909e92665a65c2cdb6029b3c201f0b4d3c596e55fb6d8053b8615401fc3e5c929c899bc30e243d73497f32fa15f476e02cf26f2573c039b771

Description

ML's radishal library for matching with Universal Levenshtein Automata.

Published: 20 Jun 2021

README

mula

ML's radishal library for matching with Universal Levenshtein Automata.

This library not only computes if strings are within a certain edit distance, but also computes what the edit distance is.

We support both the standard Levenshtein distance as well as the Demarau-Levenshtein distance which includes transpositions of two adjacent characters as a primitive edit operation.

We can also lazily feed characters into atomata and get the current edit distance.

Examples of use:

# #require "mula";;
# Mula.Strings.Lev.get_distance ~k:2 "abcd" "abdc";;
- : int option = Some 2
# Mula.Strings.Dem.get_distance ~k:2 "abcd" "abdc";;
- : int option = Some 1
# Mula.Strings.Lev.get_distance ~k:2 "abcd" "efgh";;
- : int option = None
# let lev_nfa = Mula.Strings.Lev.start ~k:2 ~str:"abcd";;
val lev_nfa : Mula.Strings.Lev.nfa_state = <abstr>
# Mula.Strings.Lev.(feed_str lev_nfa ~str:"ab" |> current_error);;
- : int option = Some 2
# Mula.Strings.Lev.(feed_str lev_nfa ~str:"abd" |> current_error);;
- : int option = Some 1
# Mula.Strings.Lev.(feed_str lev_nfa ~str:"ab" |> feed_str ~str:"dc" |> current_error);; (* counts 'd' as an insert edit *)
- : int option = Some 1
# Mula.Strings.Lev.(feed_str lev_nfa ~str:"ab" |> feed_str ~str:"dc" |> end_input);;
- : int option = Some 2

About the Name

মুলা (mula/moola) means radish in the author's first language.

Dependencies (3)

  1. ppx_inline_test
  2. ocaml >= "4.12"
  3. dune >= "2.8"

Dev Dependencies (1)

  1. odoc with-doc

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.