Logo

0x5a.live

for different kinds of informations and explorations.

GitHub - UniversalAvenue/simhash-ex: Elixir implementation of Simhash

Elixir implementation of Simhash. Contribute to UniversalAvenue/simhash-ex development by creating an account on GitHub.

Visit SiteGitHub - UniversalAvenue/simhash-ex: Elixir implementation of Simhash

GitHub - UniversalAvenue/simhash-ex: Elixir implementation of Simhash

Elixir implementation of Simhash. Contribute to UniversalAvenue/simhash-ex development by creating an account on GitHub.

Powered by 0x5a.live ๐Ÿ’—

Simhash

An Elixir implementation of Moses Charikar's Simhash.

Examples

iex> Simhash.similarity("Universal Avenue", "Universe Avenue")
0.71875
iex> Simhash.similarity("hocus pocus", "pocus hocus")
0.8125
iex> Simhash.similarity("Sankt Eriksgatan 1", "S:t Eriksgatan 1")
0.8125
iex> Simhash.similarity("Purple flowers", "Green grass")
0.5625

By default trigrams (N-gram of size 3) are used as language features, but you can set a different N-gram size:

iex> Simhash.similarity("hocus pocus", "pocus hocus", 1)
1.0
iex> Simhash.similarity("Sankt Eriksgatan 1", "S:t Eriksgatan 1", 6)
0.859375
iex> Simhash.similarity("Purple flowers", "Green grass", 6)
0.546875

Installation

The package can be installed by adding simhash to your list of dependencies in mix.exs:

def deps do
  [
    {:simhash, "~> 0.1.2"}
  ]
end

Elixir Resources

are all listed below.

Resources

listed to get explored on!!

Made with โค๏ธ

to provide different kinds of informations and resources.