All Projects → inaka → sheldon

inaka / sheldon

Licence: Apache-2.0 license
Very Simple Erlang Spell Checker

Programming Languages

erlang
1774 projects

Projects that are alternatives of or similar to sheldon

Did you mean
The gem that has been saving people from typos since 2014
Stars: ✭ 1,786 (+2734.92%)
Mutual labels:  spelling-checker, spelling-correction
ka GE.spell
ქართული ორთოგრაფიული ლექსიკონი - Georgian Spell Checking Dictionary
Stars: ✭ 24 (-61.9%)
Mutual labels:  spelling-checker, spelling-correction
Semantic-Textual-Similarity
Natural Language Processing using NLTK and Spacy
Stars: ✭ 30 (-52.38%)
Mutual labels:  spelling-correction
checkyoself
Markdown Grammar Checker for blog posts, etc.
Stars: ✭ 38 (-39.68%)
Mutual labels:  spelling-checker
Symspell
SymSpell: 1 million times faster spelling correction & fuzzy search through Symmetric Delete spelling correction algorithm
Stars: ✭ 1,976 (+3036.51%)
Mutual labels:  spelling-correction
CorrectLy
CorrectLy - Open Source Spelling & Grammar correction
Stars: ✭ 23 (-63.49%)
Mutual labels:  spelling-correction
SymSpellCppPy
Fast SymSpell written in c++ and exposes to python via pybind11
Stars: ✭ 28 (-55.56%)
Mutual labels:  spelling-correction
customized-symspell
Java port of SymSpell: 1 million times faster through Symmetric Delete spelling correction algorithm
Stars: ✭ 51 (-19.05%)
Mutual labels:  spelling-correction
Nkocr
🔎📝 This is a module to make specifics OCRs at food products and nutritional tables.
Stars: ✭ 15 (-76.19%)
Mutual labels:  spelling-correction
contextualSpellCheck
✔️Contextual word checker for better suggestions
Stars: ✭ 274 (+334.92%)
Mutual labels:  spelling-correction
sqlite-spellfix
Loadable spellfix1 extension for sqlite as python package
Stars: ✭ 13 (-79.37%)
Mutual labels:  spelling-correction
grammarify
Grammarify is a npm package that safely cleans up text that has mispellings, improper capitalization, lexical illusions, among other things.
Stars: ✭ 43 (-31.75%)
Mutual labels:  spelling-correction
spacy hunspell
✏️ Hunspell extension for spaCy 2.0.
Stars: ✭ 94 (+49.21%)
Mutual labels:  spelling-correction
LinSpell
Fast approximate strings search & spelling correction
Stars: ✭ 52 (-17.46%)
Mutual labels:  spelling-correction
spellchecker-wasm
SpellcheckerWasm is an extrememly fast spellchecker for WebAssembly based on SymSpell
Stars: ✭ 46 (-26.98%)
Mutual labels:  spelling-correction
deep-spell-checkr
Keras implementation of character-level sequence-to-sequence learning for spelling correction
Stars: ✭ 65 (+3.17%)
Mutual labels:  spelling-correction
WordSegmentationDP
Word Segmentation with Dynamic Programming
Stars: ✭ 18 (-71.43%)
Mutual labels:  spelling-correction
ocr-machine-learning
OCR Machine Learning in python
Stars: ✭ 42 (-33.33%)
Mutual labels:  spelling-correction
neuspell
NeuSpell: A Neural Spelling Correction Toolkit
Stars: ✭ 524 (+731.75%)
Mutual labels:  spelling-correction
spell
Spelling correction and string segmentation written in Go
Stars: ✭ 24 (-61.9%)
Mutual labels:  spelling-correction

Sheldon

Hex.pm Version Hex.pm Downloads Coverage Status Build Status Erlang Versions

Very Simple Erlang Spell Checker.

Note: Sheldon also suggests correct words when some word is misspelled. That functionality was highly inspired by the Elixir project spell_check.

Contact Us

If you find any bugs or have a problem while using this library, please open an issue in this repo (or a pull request :)).

And you can check all of our open-source projects at inaka.github.io.

Installation

NOTE sheldon only works with Erlang 21 or greater

  1. Clone the repo
  2. rebar3 compile

Usage

Erlang Shell

First of all Sheldon is an application and it needs to be started. You can use rebar3 shell to set the necessary paths, then use sheldon:start/0 or application:ensure_all_started(sheldon) in order to start Sheldon but if you are using Sheldon as a dependency you can let OTP starts it from your_app.app file too.

Sheldon only has two main methods, sheldon:check/1 and sheldon:check/2. As a user, you just need to use those.

1> sheldon:check("I want to check this correct text").
ok
2> sheldon:check("I want to check this misspeled text").
#{bazinga => <<"That's no reason to cry. One cries because one is sad. For example, I cry because others are stupid, and that ma"...>>,
  misspelled_words => [#{candidates => ["misspeed","misspelled"],
     line_number => 1,
     word => "misspeled"}]}

Configuration

sheldon:check/2 works like sheldon:check/1 but it accepts a Configuration parameter. With this Conf parameter we can apply some rules to the text we want to check. Those rules are ignore words, ignore patterns and ignore blocks.

This is the format (see sheldon_config.erl), no key is required:

#{ ignore_words    => [string()]
 , ignore_patterns => [regex()]
 , ignore_blocks   => [ignore_block()]
 , adapters        => [adapter()]
 }.

Then, if we call the previous sheldon:check/1 but with configuration we can skip the error

3> sheldon:check("I want to check this misspeled text", #{ignore_words => ["misspeled"]}).
ok

Adapters

Sometimes we have to check the spelling of formatted text but sheldon handles it as a plain text so we will face problems with that. One example is markdown files, if we try to check them sheldon will complain about things like '##' or '*something*'. For these cases sheldon provides adapters. An adapter is an Erlang module with an adapt/1 function which will receive a line in binary() format and returns that line transformed. For example, sheldon provides markdown_adapter which converts from markdown to plain text.

In order to use them we only have to declare them in the config file:

#{adapters => [markdown_adapter]}.

You can create your own adapter which fits your requirements, you only need to implement the sheldon_adapter behavior and to provide some code to adapt/1 function.

-spec adapt(binary()) -> iodata().
adapt(Line) ->
  ...

You can add all the adapters you want and they will be executed in order.

Examples

Check this out.

Results

sheldon:check/1 and sheldon:check/2 have the same result type, you can see sheldon_result.erl. Sheldon will return the ok atom if the check went well else it'll return

    #{ misspelled_words := [misspelled_word()]
     , bazinga          := string()
     }.

misspelled_word's list will be returned ordered by line number. If more than one misspelled word per line appears they will be ordered by order of appearance.

Dependencies

Required OTP version 23 or or higher. We only provide guarantees that the system runs on OTP23+ since that's what we're testing it in, but the minimum_otp_vsn is "21" because some systems where sheldon is integrated do require it.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].