caderek / gramma

command-line grammar checker
https://caderek.github.io/gramma/
ISC License
251 stars 18 forks source link

The command "gramma listen" recognizes a space in the string while there is none #5

Closed DevSilv closed 5 years ago

DevSilv commented 5 years ago

Steps to reproduce

  1. Run the application with the following command:
    gramma listen "."
  2. The output ~is~ contains the following:
    Explanation: Don't put a space before the full stop

Actual behavior

The application recognizes a space.

Expected behavior

The application does not recognize a space. Instead, for example, the explanation might mention starting the sentence from a dot.

caderek commented 5 years ago

Unfurtanetelly it is out of the scope of the project - I have no control over backend API. But your issue reminded me that I should prefilter data and not send the request at all if it's pointless (empty string, single character, etc).

I will leave it open until I add it.

DevSilv commented 5 years ago

@caderek In case of limited requests that would be a good idea. (But in general, I would not expect such input as pointless, in particular in case of piping and similar.)

caderek commented 5 years ago

I decided to not touch this - I think it is a bad idea to try to monkey patch someone else's API (can change without me knowing it), I will present results "as is".

But I decided to skip checks for empty strings: https://github.com/caderek/gramma/commit/0cb33b22445a5d5f7f0977d20474fd44ca4d5d73

DevSilv commented 5 years ago

OK, that sounds reasonably. But I wonder, does the GrammarBot API mention anywhere handling an empty string?