Skip to main content

Google Spell Checker

Project description

Google Spell Checker

It is a simple multilingual Spell Checker using Google Text Completion.

Installation

pip install google-spell-checker

Usage

GoogleSpellChecker.check(word) returns a tuple, the first variable is the correctness of the text, the second variable is the most possible correct word (or None if it is a correct word).

from google_spell_checker import GoogleSpellChecker

spell_checker = GoogleSpellChecker()
print(spell_checker.check("developmnet"))
# (False, 'development')
print(spell_checker.check("martialartz"))
# (False, 'martial arts')
print(spell_checker.check("amoxicillin-clavulanic"))
# (True, None)

Different Language Code

The GoogleSpellChecker uses the default language code "en-EN", but you can change it by passing the parameter lang to GoogleSpellChecker() as follow:

# For example, we use lang="id" for Indonesian
spell_checker = GoogleSpellChecker(lang="id")
print(spell_checker.check("sayalaparsekali, say ingn makn dirumha"))
# (False, 'saya lapar sekali, saya ingin makan di rumah')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google_spell_checker-0.2.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

google_spell_checker-0.2.1-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page