Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
This module computes a matrix keeping track of the costs necessary to edit one piece of text so that it is transformed into another one From that matrix it is possible to extract the sequence of edit operations with the minimum cost
Synopsis
- createEditMatrix :: Costs a -> [a] -> [a] -> Matrix Cost
- makeEditOperations :: forall a. Vector a -> Vector a -> Matrix Cost -> Vector (EditOperation a)
- getElement :: Int -> Int -> Matrix a -> a
- setElement :: a -> Int -> Int -> Matrix a -> Matrix a
Documentation
createEditMatrix :: Costs a -> [a] -> [a] -> Matrix Cost Source #
Create a edit matrix where costs are computed using dynamic programming
makeEditOperations :: forall a. Vector a -> Vector a -> Matrix Cost -> Vector (EditOperation a) Source #
From the original lists of characters, given the cost matrix return a list of edit operations allowing to edit one text and eventually get the second one
getElement :: Int -> Int -> Matrix a -> a Source #
Return the element at position i, j in the matrix A matrix in the matrix package is 1-indexed but all the computations in this module are 0-indexed so we need to shift the indices
setElement :: a -> Int -> Int -> Matrix a -> Matrix a Source #
Set the element at position i, j in the matrix A matrix in the matrix package is 1-indexed but all the computations in this module are 0-indexed so we need to shift the indices