Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

distributed-trie

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

distributed-trie

  • 0.8.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

What is distributed-trie

  • distributed-trie is a trie library on key-value store.
  • It is scalable.
  • It supports Tokyo Cabinet / memcached / gdbm / pure hash / Redis / DynamoDB / SimpleDB

The reason why i developed

  • I need a trie library for Sekka ( japanese input method ).
  • I need a trie library which written in pure Ruby.
  • I need a trie library which can scale out.

Installing

gem install distributed-trie

Features

  • Add keyword to trie.
  • Delete keyword to trie. ( not implemented... )
  • commonPrefixSearch by keyword.
  • fuzzySearch by jaro winker edit distance.
  • search with user-defined-function.

Architecture

  • distributed-trie gem only manage trie data structure.
  • You should manage your application data which corresponds to trie key.

Figure

Sample code

require 'distributedtrie'
require 'distributedtrie/kvs/tokyocabinet'
kvsTc = DistributedTrie::KvsTc.new( '/tmp/distributed-trie.tch' )
trie = DistributedTrie::Trie.new( kvsTc, "Sample::" )
trie.addKey!( "apple"       )
trie.addKey!( "application" )
trie.addKey!( "orange"      )
trie.commit!
result = trie.commonPrefixSearch( "app" )
print result
# =>  [ "apple", "application" ]
result = trie.fuzzySearch( "app", 0.80 )
print result
# =>  [[0.9066666666666667, "apple"], [0.8236914600550963, "application"]]

Requires

  • Ruby 1.9.1 or higher
  • JRuby 1.6.6 or higher
  • fuzzy-string-match gem

Author

  • Copyright (C) Kiyoka Nishiyama kiyoka@sumibi.org

See also

License

  • BSD License

FAQs

Package last updated on 26 Apr 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc