https://github.com/joshuaclayton/similar-names
https://github.com/joshuaclayton/similar-names
dendrogram haskell levenshtein
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/joshuaclayton/similar-names
- Owner: joshuaclayton
- License: mit
- Created: 2017-04-15T09:47:10.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-15T21:48:05.000Z (over 8 years ago)
- Last Synced: 2024-12-28T01:32:58.224Z (10 months ago)
- Topics: dendrogram, haskell, levenshtein
- Language: Haskell
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# similar-names
This is a package allowing for reduction/grouping of a list based on edit
distance clustering of a field.## Usage
```haskell
import qualified Data.SimilarNames as Sdata Person = Person
{ pName :: String
, pAge :: Int
} deriving (Eq, Ord, Show)instance S.IsNamed Person where
toName = pName
updateName p updatedName = p { pName = updatedName }S.reduceSimilarlyNamed [Person "Jane Doe" 20, Person "Jane K Doe" 20, Person "John Doe" 20]
-- results in: [Person "Jane Doe" 20, Person "John Doe" 20]S.groupSimilarlyNamed [Person "Jane Doe" 20, Person "Jane K Doe" 20, Person "John Doe" 20]
-- results in: Map.fromList [(Person "Jane Doe" 20, [Person "Jane Doe" 20, Person "Jane K Doe" 20]), (Person "John Doe" 20, [Person "John Doe" 20])]
```## License
Copyright 2017 Josh Clayton. See the [LICENSE](LICENSE).