Code Monkey home page Code Monkey logo

spelll's Introduction

Spelll build

Fuzzy string searching, using Levenshtein automaton. Can be used for spell-checking.

API documentation can be found here, and the source code here.

Some examples:

# #require "spelll";;
# let dfa = Spelll.of_string ~limit:1 "hello";;
val dfa : Spelll.automaton = <abstr>
# Spelll.match_with dfa "hell";;
- : bool = true
# Spelll.match_with dfa "hall";;
- : bool = false
# let idx = Spelll.Index.of_list ["hello", "world"; "hall", "vestibule"];;
val idx : string Spelll.Index.t = <abstr>
# Spelll.Index.retrieve_l idx ~limit:1 "hell" ;;
- : string list = ["world"; "vestibule"]
# Spelll.Index.retrieve_l idx ~limit:1 "hall" ;;
- : string list = ["vestibule"]

License

This software is free, under the BSD-2 license. See the LICENSE file.

Build

You only need OCaml (>= 4.02 should be enough) and dune and seq. Type

$ make
$ make install

spelll's People

Contributors

c-cube avatar kit-ty-kate avatar rgrinberg avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

spelll's Issues

inconsistent example

Hi, the library looks nice, but the example is very confusing

# let idx = Spelll.Index.of_list ["hello", "world"; "hall", "vestibule"];;
val idx : string Spelll.Index.t = <abstr>
# Spelll.Index.retrieve_l idx ~limit:1 "hell" ;;
- : string list = ["world"; "vestibule"]
# Spelll.Index.retrieve_l idx ~limit:1 "hall" ;;
- : string list = ["vestibule"]

Stack overflow

Hi, when using spelll on, admittedly, very big maps, I seem to get stack overflows when trying to retrieve some elements. Here is the relevant part of the backtrace:

Stack overflow
        Raised by primitive operation at file "src/Spelll.ml", line 253, characters 22-40
        Called from file "set.ml", line 348, characters 18-35
        Called from file "map.ml", line 123, characters 18-33
        Called from file "map.ml", line 130, characters 21-33
        Called from file "map.ml", line 130, characters 21-33
        Called from file "map.ml", line 130, characters 21-33
        Called from file "map.ml", line 130, characters 21-33
        Called from file "src/Spelll.ml", line 375, characters 18-47
        Called from file "src/Spelll.ml", line 390, characters 24-49
        Called from file "list.ml", line 110, characters 12-15
        Called from file "src/Spelll.ml", line 353, characters 6-305
        Called from file "list.ml", line 110, characters 12-15
        Called from file "src/Spelll.ml", line 353, characters 6-305
        Called from file "list.ml", line 110, characters 12-15
        Called from file "src/Spelll.ml", line 353, characters 6-305
        Called from file "list.ml", line 110, characters 12-15
        Called from file "src/Spelll.ml", line 353, characters 6-305
        Called from file "list.ml", line 110, characters 12-15
        Called from file "src/Spelll.ml", line 353, characters 6-305
        Called from file "list.ml", line 110, characters 12-15
        Called from file "src/Spelll.ml", line 353, characters 6-305
        Called from file "list.ml", line 110, characters 12-15
        Called from file "src/Spelll.ml", line 353, characters 6-305
        Called from file "list.ml", line 110, characters 12-15
        Called from file "src/Spelll.ml", line 353, characters 6-305
        Called from file "list.ml", line 110, characters 12-15
        Called from file "src/Spelll.ml", line 353, characters 6-305
        Called from file "src/Spelll.ml", line 408, characters 6-33
        Called from file "src/Spelll.ml" (inlined), line 442, characters 14-28
        Called from file "src/Spelll.ml", line 543, characters 16-34

This is using version 0.3 on ocaml 4.08.1

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.