{"id":17335741,"url":"https://github.com/thsutton/edit-distance-vector","last_synced_at":"2025-04-14T18:33:13.141Z","repository":{"id":29808118,"uuid":"33352521","full_name":"thsutton/edit-distance-vector","owner":"thsutton","description":"Calculate edit scripts and distances between Vectors.","archived":false,"fork":false,"pushed_at":"2019-01-14T23:29:13.000Z","size":53,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-06T19:09:58.590Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thsutton.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-03T07:33:10.000Z","updated_at":"2023-03-02T21:37:57.000Z","dependencies_parsed_at":"2022-09-11T10:41:31.569Z","dependency_job_id":null,"html_url":"https://github.com/thsutton/edit-distance-vector","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thsutton%2Fedit-distance-vector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thsutton%2Fedit-distance-vector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thsutton%2Fedit-distance-vector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thsutton%2Fedit-distance-vector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thsutton","download_url":"https://codeload.github.com/thsutton/edit-distance-vector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248937051,"owners_count":21186148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T15:12:01.441Z","updated_at":"2025-04-14T18:33:13.112Z","avatar_url":"https://github.com/thsutton.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Edit Distance: Vector\n=====================\n\n[![Build Status][badge]][status]\n\nThis is a small library for calculating the edit distance and edit script\nbetween two vectors. It is generic enough that you should be able to use it\nwith vectors containing *values* of any type you like, with *changes* described\nby any type you like, and with *costs* represented by any type you like (with a\nfew restrictions).\n\nInstalling\n----------\n\nThe `edit-distance-vector` package is a normal Haskell library and can be\ninstalled using the Cabal package management tool.\n\n````{bash}\ncabal update\ncabal install edit-distance-vector\n````\n\n`edit-distance-vector` is [automatically tested][status] against Stackage\nLTS-3, LTS-5, LTS-6, LTS-7, and LTS-8 using the Travis CI service.\n\nUsage\n-----\n\nThe interface to `edit-distance-vector` is very small; just import\n`Data.Vector.Distance`, create a `Params` value with the correct operations to\ndeal with your types, and pass this to `leastChanges` along with your\n`Vector`s.\n\n````{haskell}\nimport           Data.Monoid\n\nimport qualified Data.Vector          as V\nimport           Data.Vector.Distance\n\n-- | Editing vectors of 'Char' values, with '(String, Int, Char)' describing\n--   changes, and the additive monoid of 'Int' describing costs.\nstr :: Params Char (String, Int, Char) (Sum Int)\nstr = Params\n    { equivalent = (==)\n    , delete     = \\i c    -\u003e (\"delete\", i, c)\n    , insert     = \\i c    -\u003e (\"insert\", i, c)\n    , substitute = \\i c c' -\u003e (\"replace\", i, c')\n    , cost = const (Sum 1)\n    , positionOffset = \\ (op, _, _) -\u003e if op == \"delete\" then 0 else 1\n    }\n\nmain :: IO ()\nmain = do\n    print $ leastChanges str (V.fromList \"I am thomas\")\n                             (V.fromList \"My name is Thomas\")\n````\n\n(See `test/sample.hs` for a version of this code that is compiled\nby the automated test suite.)\n\n[badge]: https://travis-ci.org/thsutton/edit-distance-vector.svg?branch=master\n[status]: https://travis-ci.org/thsutton/edit-distance-vector\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthsutton%2Fedit-distance-vector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthsutton%2Fedit-distance-vector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthsutton%2Fedit-distance-vector/lists"}