Skip to main content

A small framework to test and compare mobile keyboards

Project description

kebbie

A small framework to test and compare mobile keyboards

GitHub release Test status Lint status Coverage status Docs licence

DescriptionInstallUsageContribute
Documentation

kebbie_logo

Description

kebbie is a small framework for testing and benchmarking mobile keyboards.
The primary goal of this package is to establish a cohesive and standardized method for evaluating the various NLP capabilities of a mobile keyboard and comparing them to existing alternatives.

kebbie achieves this through the following two features :

  • An easy-to-use evaluation function that facilitates the testing of multiple NLP functionalities offered by a mobile keyboard : auto-correction, auto-completion, next-word prediction, and swipe gesture recognition.
  • A command-line interface for running the evaluation on established keyboards, operated within emulator.

Install

Install kebbie by running :

pip install kebbie

For development, you can install it locally by first cloning the repository :

git clone https://github.com/FleksySDK/kebbie.git
cd kebbie
pip install -e .

Usage

If you want to test how well your custom code performs, just declare your own instance of Corrector, and run the evaluate() function !

For example, here is how to test the auto-correction provided by pyspellchecker :

import json
from typing import List

from spellchecker import SpellChecker
from kebbie import Corrector, evaluate


class ExampleCorrector(Corrector):
    def __init__(self):
        self.spellchecker = SpellChecker()

    def auto_correct(self, context: str, keystrokes, word: str) -> List[str]:
        cands = self.spellchecker.candidates(word)
        return list(cands) if cands is not None else []


if __name__ == "__main__":
    corrector = ExampleCorrector()
    results = evaluate(corrector)

    # Save the results in a local file for later inspection
    with open("results.json", "w") as f:
        json.dump(results, f, ensure_ascii=False, indent=4)

[!TIP] Make sure to check the full documentation for a detailed explanations of how to use the code !


If instead you want to test an existing keyboard, then you just have to start appium, start your emulator and install the keyboard you want to test, and finally run :

# For GBoard on Android emulator
kebbie evaluate -K gboard --all_tasks

# For iOS keyboard on iOS emulator
kebbie evaluate -K ios --all_tasks

[!TIP] Make sure to check the full documentation for a detailed explanations of how to setup emulators and how to use the command line !

Contribute

To contribute, install the package locally, create your own branch, add your code (and tests, and documentation), and open a PR !

Pre-commit hooks

Pre-commit hooks are set to check the code added whenever you commit something.

[!NOTE] If you never ran the hooks before, install it with :

pip install -e .[hook]
pre-commit install

Then you can just try to commit your code. If your code does not meet the quality required by linters, it will not be committed. You can just fix your code and try to commit again !

[!TIP] You can manually run the pre-commit hooks with :

pre-commit run --all-files

Tests

When you contribute, you need to make sure all the unit-tests pass. You should also add tests if necessary !

[!NOTE] Install the dependencies for testing with :

pip install -e .[test]

You can run the tests with :

pytest

Tests are not included in the pre-commit hooks, because running the tests might be slow, and for the sake of developers we want the pre-commit hooks to be fast !

Pre-commit hooks will not run the tests, but it will automatically update the coverage badge !

Documentation

The documentation should be kept up-to-date. You can visualize the documentation locally by running :

mkdocs serve

[!NOTE] Before running this command, you need to install the documentation dependencies :

pip install -e .[docs]

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

kebbie-0.5.1.tar.gz (43.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kebbie-0.5.1-py3-none-any.whl (61.0 kB view details)

Uploaded Python 3

File details

Details for the file kebbie-0.5.1.tar.gz.

File metadata

  • Download URL: kebbie-0.5.1.tar.gz
  • Upload date:
  • Size: 43.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for kebbie-0.5.1.tar.gz
Algorithm Hash digest
SHA256 70847839b1283a336ba32c445c639234119d2cc7c770262440e5eef30aae7a3a
MD5 4d41363c8513e7d5ab3fac75acad8a84
BLAKE2b-256 93dfee87e40d94508bf6ebacf8ca319a9b92d8536499e32432436928e8d9629d

See more details on using hashes here.

File details

Details for the file kebbie-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: kebbie-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 61.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for kebbie-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7ca7371a1fca30acb29a0b7d4163d89910d24f1a82bbdeccef3a593a97e628c
MD5 fb82bb7d272d6c2c29e8e7417e5e7e4a
BLAKE2b-256 179fbb3689d89d16b39f0de3c9676018ed425a74760bea80094be5b40a46272b

See more details on using hashes here.

Supported by

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