This repository contains a small, simple and efficient implementation of the Lempel-Ziv complexity algorithm.
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
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).
Demo on a Jupyter notebook
See this notebook: on nbviewever, which also shows the Python implementations.
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
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
The Python 🐍 package is published here: Naereen/Lempel-Ziv_Complexity, and see here for its documentation.
Julia version 0.5 at least.
MIT Licensed (file LICENSE). © Lilian Besson, 2017.