grammarbot package

Module contents

class grammarbot.GrammarBotApiResponse(json: dict)

Bases: object

Represents the JSON API returned by the server.

detected_language

Gives the language code for the detected langauge.

matches

Different matches detected by the GrammarBot API.

raw_json

Returns the raw JSON response that was returned by the server.

result_is_incomplete

States whether these results are complete or incomplete.

class grammarbot.GrammarBotClient(api_key: str = 'python-default')

Bases: object

A GrammarBot-API wrapper client.

check(text: str, lang: str = 'en-US')

Check a given piece of text for grammatical errors.

Parameters:
  • text – Text to be checked using the API.
  • lang – Language code for the text language.
class grammarbot.GrammarBotMatch(match_json: dict)

Bases: object

Represents a GrammarBot match detected by the API.

category

Gives the rule category.

corrections

Gives a list of possibly correct variation of the input text.

message

Returns the message for the given match.

replacement_length

Gives the length of the string that has to be replaced.

replacement_offset

Gives the offset at which the replacement should be made.

replacements

Gives a list of possible replacements.

rule

Gives the rule ID which applies for this match.

type

Gives the type of match.