Coder Social home page Coder Social logo

ctst's People

Contributors

nlehuen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ctst's Issues

Compact memory storage implementation

Currently, only a malloc-based storage has been implemented. This is the
bare minimum and is pretty inefficient (the ratios computed in the test
program show it).

It is possible to implement a compact in-memory storage by using a careful
encoding of node links (some bits in a short header tell which links are
defined in the node, while the remaining bits are for the number of
characters in the node).

Implement tst_contains

Implement a tst_contains method that just checks whether a key has
associated data in the tree. This is useful in the case where loading data
in memory is expensive, so one might want not to use ctst_get for this kind
of test.

Disk-based storage

As the storage system is abstracted, a disk-based storage could be
implemented for big trees.

Fuzzy match algorithm

Like in pytst, implement a fuzzy matcher, which call a callback method for
all key/value pairs within a given Levenshtein distance of an input key.

Extra credits for implementing the fuzzy match with the Damerau-Levenshtein
distance :

http://en.wikipedia.org/wiki/Damerau-Levenshtein_distance

Aho-Corasick scanner

Like in pytst, implement an Aho-Corasick scanner. This would take an input
string and call callback methods as soon as substrings match some key in
the tree. A file input could also be implemented.

Iterators

Implement iterators that match the visitors : full, from key, of fuzzy.

Should be implemented with the same techniques as used in the visitor. The iterator
object will keep a ctst_stack instance to maintain its state of iteration. With a
little luck, no other state is required and a stack object IS an iterator. In this
case, write iterator functions that use the stack and refactor _ctst_visit_all to ise
those functions.

Well obviously no other state than the stack is required when iterating on all the
entries of the tree, but if there is a query (a wildcard or fuzzy search) the query
and position in the query must be stored.

Wildcard matches

Implement wildcard matches like in pytst, that is to say a way to query the tree with
simple wildcards like ? or \* (glob-style, NOT regex style which would be
much more complicated).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.