Skip to main content

JSON Dictionary Patches for Plover

Project description

Dictionary Patches for Plover

PyPI GitHub

Dictionary Patches are patch files that allow you to patch JSON dictionaries without editing the original files. This is useful if the base dictionary file is from an external source, such as the default main.json dictionary from Plover.

Format

{
  "source": "main.json",
  "add": {
    "SKWR": "just",
    "TKEURBGS": "dictionary"
  },
  "delete": [
    "SHRAOEP/HRES",
    "TOED/AS"
  ]
}

Dictionary patches have the extension dicp. They are written in the JSON format, with three sections:

  • source: Base JSON file; must be in the same directory
  • add: Additions or overwrites
  • delete: Deleted entries. Note that only outlines are recorded, and they are surrounded in square brackets []

Usage

When using dictionary patches, you are recommended to disable the base dictionary, since the patch itself will act as a normal dictionary. You can delete and edit entries in Plover's dictionary editor on the patch itself, and the patch file will update accordingly based on the difference between the edited dictionary and the base file.

To update the base file, simply replace the original base file with the updated version with the same file name, and the patch will work as usual.

Converting dictionaries to Patches

If you already have a regular JSON dictionary that contains edits from an original dictionary file, you can create a patch file like this, with a target parameter containing the name of the edited dictionary file.

{
  "source": "main.json",
  "target": "edited_main.json"
}

The next time you edit the patch, the file will be expanded into its regular additions/deletions format in the example above. You are recommended to keep a backup of the original edited dictionary.

Converting Patches to Dictionaries

If you would like to create a copy of the edited dictionary in JSON format, simply add a generate parameter containing the name of the output file:

{
  "generate": "edited_dict.json",
  ...
}

The edited dictionary will be generated as a JSON dictionary every time you update the patch from within Plover.

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

plover-dictionary-patch-0.0.4.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

plover_dictionary_patch-0.0.4-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file plover-dictionary-patch-0.0.4.tar.gz.

File metadata

  • Download URL: plover-dictionary-patch-0.0.4.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for plover-dictionary-patch-0.0.4.tar.gz
Algorithm Hash digest
SHA256 69a066836960f2c39089be220b321a33462bfe4d0fedde4c81088d40a5fb8387
MD5 861c1079aedda42086a30e7cb1511a37
BLAKE2b-256 824ccaadae3bf59629f83a70c40c5511b3b35e4c12ad0d79153d38df28c00257

See more details on using hashes here.

File details

Details for the file plover_dictionary_patch-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: plover_dictionary_patch-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for plover_dictionary_patch-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a657e878232d2bdb5ef1a047e6378852041642991224df791779d305ee79dbe9
MD5 2aa559e1f50eb4645b6d94d0add417b2
BLAKE2b-256 baf5032263371e53df54edc70634dc2b9452b9d9308e7e5fa918de90918f5e4c

See more details on using hashes here.

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