Coder Social home page Coder Social logo

sheldon's Issues

A word with hyphen is not being suggested by spell checker.

Hi Team,

I have tested this sheldon spell checker utility. I did see, the the hyphen words are not suggested by the spell checker.
for example:
self-ownership
self-paid
self-painter
self-pampered
self-pampering
self-panegyric
self-parasitism
self-parricide
self-partiality
self-paying
self-peace

Is there something i am missing to validate this?.

increase the worker pool timeout

Testing with spellingCI I saw 5 seconds is not good enough. We can increase the default timeout or/and make that number configurable from config file

How to add new Language? Namely Portuguese

I see that the only existing dictionary is English, but I'd like to use it for Portuguese-BR. Seems like it would only need a bazinga.txt and a dictionary.txt, correct?

If I can provide these, would you merge the PR?

Thanks!

Removing try/catch in sheldon_suggestions_server: suggestions/2

in this code

suggestions(MisspelledWords, Lang) ->
  try rpc:pmap({?MODULE, add_suggestions}, [Lang], MisspelledWords) of
    Result -> Result
  catch
    exit:badrpc:Stacktrace ->
      error_logger:error_msg( "~p:~p >> Error: badrpc~n\tStack: ~p"
                            , [?MODULE, ?LINE, Stacktrace]
                            ),
      MisspelledWords
  end.

we can remove the catch since the rpc:pmap/3 doesn't throw an exception

Windows compile issue

sheldon version

0.3.0

OS version

Windows

Steps to reproduce

Compile sheldon on Windows.

Current behavior

C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/mingw32-make -C d:/a/rebar3_sheldon/rebar3_sheldon/_build/default/lib/hoedown libhoedown.a
mingw32-make[1]: Entering directory 'd:/a/rebar3_sheldon/rebar3_sheldon/_build/default/lib/hoedown'
cc -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -Isrc -c -o src/autolink.o src/autolink.c
process_begin: CreateProcess(NULL, cc -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -Isrc -c -o src/autolink.o src/autolink.c, ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make[1]: *** [Makefile:92: src/autolink.o] Error 2
mingw32-make[1]: Leaving directory 'd:/a/rebar3_sheldon/rebar3_sheldon/_build/default/lib/hoedown'
mingw32-make: *** [Makefile:33: ../priv/emarkdown.so] Error 2
mingw32-make: Leaving directory 'd:/a/rebar3_sheldon/rebar3_sheldon/_build/default/lib/emarkdown/c_src'
===> Hook for compile failed!

Expected behavior

The sheldon can be able compile on Windows.

Make `bazinga` as optional field by config

sheldon version

0.3.0

OS version

Ubuntu

Description

  • Motivation
    Not all users want to see bazinga in response from sheldon. It would be great have configuration for this behavior.
  • Proposal
    Add new config option show_bazinga true/false to skip bazinga message from sheldon in response.

Current behavior

The bazinga field in response always provided.

Expected behavior

The bazinga field in response should be configurable.

Handle hyphenated words

sheldon version

0.4.1

OS version

MacOS 11.6

Description

  • Motivation
    I want to be able to write hyphenated words.
  • Proposal
    Analyze stuff like non-breaking as two words: non and breaking.

Current behavior

For instance…

src/spillway_srv.erl:51: The word "non-incrementing" in comment is unknown.

Expected behavior

No warnings.

Typo generator

sheldon version

0.2.0

OS version

Ubuntu

Description

  • Motivation
    Speeding up the library.
  • Proposal
    • Create typo generator for generate typo_dictionary.txt based on dictionary.txt and put it into priv/lang/eng/* or move into separate repo, because the size of file can be large for eg hex.pm. As result for each word from dictionary.txt will be put into eg ets all possible typos. Which in turn will lead to the fact that all possible options will already be generated and available, the shadlon will not need to spend additional time on additional generation, words are either there or not.
    • Also don't forget about association of similar words which must be linked to each other thus one misspelled word can have several possible variants but no more 1 +- 5 or 10.

Current behavior

The sheldon try generate and provide a lot of candidates for each word in real time.

Expected behavior

All possible candidates should be insert before sheldon will be loaded/started.

Config

It might be worth adding an option to control whether the new behavior is turned on or off.

The sheldon crashes when put unicode chars

sheldon version

0.2.1

OS version

Ubuntu

Steps to reproduce

1> sheldon:check("this comment: ’").
** exception error: bad argument
     in function  re:split/2
        called as re:split([116,104,105,115,32,99,111,109,109,101,110,116,58,
                            32,8217],
                           "\n")
        *** argument 1: not an iodata term
     in call from sheldon:do_check/2 (/.../sheldon/src/sheldon.erl, line 58)

Current behavior

The sheldon crashes when put unicode chars.

Expected behavior

The sheldon work with unicode chars.

Cache of suggested suggestions

sheldon version

0.2.0

OS version

Ubuntu

Description

  • Motivation
    An incorrect 4-character word can create about +- 250 possible suggestions. In the current implementation, the generating of suggestions happens each time for any duplicates words which ultimately increases the load to system.
  • Proposal
    Add separate table for already generated suggested suggestions as for success as for empty suggestions for each word what was already checked.

Current behavior

Cache of suggested suggestions is missed.

Expected behavior

Cache of suggested suggestions is missed implemented.

Config

Optional: it might be worth considering an additional option to enable and disable the cache of suggested suggestions.

improve performance

sheldon is spending almost 40 seconds when starts. The problem is converting from the keys list to a set when starting the dictionary

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.