Skip to main content

plover-auto-identifier

You don't have to keep typing KPA* or RUPBD while programming.

Example usage

  • Type THRAEUT R*UPBD STROEBG, translate_stroke is printed.
  • From the next time, typing THRAEUT STROEBG will automatically create translate_stroke.
  • The first step is not necessary with editor integration.

This program is available on GitHub and PyPI. Report bugs on GitHub.

Note that this program uses some internal API of Plover, and thus is not guaranteed to work on any given Plover versions.

Configuration

Create a file named plover_auto_identifier_config.json in Plover's configuration folder with the content:

{
"max_size": 100000000
}

Fields:

  • max_size: the maximum size of a file in bytes that a file can be loaded automatically (to read the words from). -1 means unlimited.

  • blacklist: list of files to be used as dictionaries to be excluded.

    To explain, because of how the feature currently work, if you type something like Maybe or are then it will be added to the dictionary, which rules out valid separated-words such as may be or a {re^}. So the blacklist will consist of (Plover-formatted dictionary) files such that words inside it will not be automatically added.

    The path can either be absolute or relative to the configuration directory (e.g. main.json)

Features

  • Define a dictionary entry mapped to =auto_identifier_mark to mark the most recently typed word as an identifier (only works if the identifier is stroked with no more than 10 translations)
    Note that identifiers are also mapped automatically.

  • Define a dictionary entry mapped to =auto_identifier_remove to unmap and revert the most recently automatically converted identifier (only works if the translation is recent)

  • Send to the named pipe \\.\pipe\plover_auto_identifier (Windows) or socket /<tempdir>/plover_auto_identifier_socket (UNIX) a Python string being the file name to read the list of identifiers from that file (with authkey=None).

    The file must be encoded in UTF-8 encoding.

    The existing identifiers will be removed.

    Note that it's necessary to send only one message for each connection.

For example, you can place this code into .vimrc (UNIX system):

function s:NotifyPloverAutoIdentifier()
pythonx << EOF
import vim
from multiprocessing import connection
filepath=vim.eval('expand("%:p")')
if filepath: #if the user edit a new buffer, filepath might be empty
	try:
		c=connection.Client("/tmp/.plover_auto_identifier_socket")
		try:
			c.send(("file", filepath))
		finally:
			c.close()
	except FileNotFoundError:
		pass # the plugin is not listening
	except OSError as e: # weird behavior
		print(e)
		
EOF
endfunction

augroup vimrc_notify_plover_auto_identifier
	auto!
	auto BufEnter,BufWritePost * call s:NotifyPloverAutoIdentifier()
augroup END

Idea:

  • Integrate with some editor to load the word list (done)
  • Also track the output for the word list. (done)
    • But if the word typed is deleted, also remove that word from the word list. (TODO)
    • That is, if there's no editor integration (TODO)
  • Given a word list...
    • If user stroke A/B/C -> "a b c", automatically convert it to "aBC" (assuming camel case)
    • Then if user press * there are two options
      • Revert to "a b c" (note: do not reform the word immediately!)
      • Revert to "a b" (which is the one that makes the most sense with Plover's default meaning of undo)
        • Note: handle the case that the last "formed" word/translation has replaced entries!
      • Delete the whole word
    • In the latter 2 cases there should be a stroke that undo the conversion
    • Do not convert anything if there's any no-op stroke!
      • No-op: for example delete-space TK-LS, camel-case, or underscore.
    • Only change new content...?
      • For example, if the user stroke A/B, then add aB to the word list, then undo to the point with that content "a b" it should not be spontaneously changed to "aB".
      • But what if the user delete the "b" then stroke it back?

Release files for plover-auto-identifier 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plover-auto-identifier 0.1.3
File Size Uploaded
plover_auto_identifier-0.1.3.tar.gz 22.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for plover-auto-identifier 0.1.3
File Interpreter ABI Platform
plover_auto_identifier-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 45.4 kB

Release files / plover_auto_identifier-0.1.3.tar.gz

Download URL plover_auto_identifier-0.1.3.tar.gz
Size 22.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ed96dc29c061a7cef2cecb81bc912ff7ec4f102f3ead437a8f45ac4470ef208a
BLAKE2b-256 checksum
How to use checksums
3ee47867e365fb200dec2a810e282d40b6157aac176fdd083e747ba36062ae7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.1

Release files / plover_auto_identifier-0.1.3-py3-none-any.whl

Download URL plover_auto_identifier-0.1.3-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2018ab155de8afc4883182315dd2f065d80af6a43a2d2d2ab7add1fba44d2699
BLAKE2b-256 checksum
How to use checksums
8eaf3e49f3ea57bd740079ad573df1a9bc454277b38c587388792ecec14a1d65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.1

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page