Julia implementation of Lempel-Ziv Complexity
This repository contains a small, simple and efficient implementation of the Lempel-Ziv complexity algorithm.
Examples
Simple usage
If the LempelZiv.jl
file is accessible in your PATH or in Julia's path:
julia> import LempelZiv
julia> s = "1001111011000010"
julia> LempelZiv.lempel_ziv_complexity(s) # 1 / 0 / 01 / 11 / 10 / 110 / 00 / 010
8
Documentation
See this file.
The documentation is generated with Documenter.jl but I don't master it very well yet. Sorry if the documentation is incomplete!
- Reference: this short lecture note by Peter Shor (Oct.2005).
Jupyter notebook
Demo on aSee this notebook: on nbviewever, which also shows the Python implementations.
Install and build
Manually ?
Easy!
Clone this repository, go in the folder, test, and if it works, use the src/LempelZiv.jl file.
$ cd /tmp/
$ git clone https://GitHub.com/Naereen/LempelZiv.jl
$ cd LempelZiv.jl/src/
$ julia LempelZiv.jl test # should pass
$ # use this file if you want
With Pkg ?
This project is hosted on the METADATA.jl package repository.
$ julia
julia> Pkg.install("LempelZiv") # should work
# now test it
$ julia -E "import LempelZiv; 6 == LempelZiv.lempel_ziv_complexity(\"1001111011000010\")" # test
Python implementation ?
The Python 🐍 package is published here: Naereen/Lempel-Ziv_Complexity, and see here for its documentation.
About
Language?
Julia version 0.5 at least.
📜 License ?
MIT Licensed (file LICENSE). © Lilian Besson, 2017.