Huffman coding. Lossless data compression.
| Source | Shields |
|---|---|
| Project | |
| Health | |
| Repository | |
| Activity |
bower install purescript-huffmanimport Huffman (composeCodewords, encodeWith, decodeWith)
str = "A strongly-typed functional programming language that compiles to JavaScript"codewords = composeCodewords str
show codewords
>>> fromFoldable [
(Tuple "001")
(Tuple - "000110")
(Tuple A "000111")
(Tuple J "000100")
(Tuple S "000101")
(Tuple a "1110")
(Tuple c "10011")
(Tuple d "011010")
(Tuple e "11010")
(Tuple f "011011")
(Tuple g "1010")
(Tuple h "011000")
(Tuple i "0111")
(Tuple l "0100")
(Tuple m "11011")
(Tuple n "1011")
(Tuple o "1100")
(Tuple p "0101")
(Tuple r "1000")
(Tuple s "00000")
(Tuple t "1111")
(Tuple u "00001")
(Tuple v "011001")
(Tuple y "10010")
]encoded = encodeWith str codewords
show encoded
>>> 000111001000001111100011001011101001001001000011011111001001011101001101000...decoded = decodeWith encoded codewords
show decoded
>>> "A strongly-typed functional programming language that compiles to JavaScript"To run tests:
pulp testThis repository's documentation is hosted on Pursuit.
To generate the documentation locally:
pulp docsTo run linters:
nps lintTo run formatters:
nps formatThis repository uses GitHub Actions to lint and test each commit. Each commit should be formatted and its corresponding documentation should be updated.
This repository adheres to semantic versioning standards. For more information on semantic versioning visit semver.
Bump2version is used to version and tag changes. For example:
bump2version patchPlease read this repository's changelog for details on changes that have been made.
Please read this repository's guidelines on contributing for details on the process for submitting pull requests. Moreover, our code of conduct declares our collaboration standards.
- Joel Lefkowitz - Initial work
Lots of love to the open source community!