项目作者: a3f

项目描述 :
Script your own InputMethods for OS X (Franco-Arabic example included!)
高级语言: Objective-C
项目地址: git://github.com/a3f/Bowdlator.git
创建时间: 2016-09-20T19:01:40Z
项目社区:https://github.com/a3f/Bowdlator

开源协议:GNU General Public License v3.0

下载


THIS IS WIP.







Bowdlator icon

Bowdlator


Bowdlator is an extensible InputMethod for Mac OS X.




bowdlerize /bōd-lə-ˌrīz/
  • The omission or removal of material considered vulgar or indecent.

translator /ˈtɹænzleɪtɚ/
  • One that makes a new version of a source material in a different language or format.


What is it?

Everything typed in, while the Bowdlator InputMethod is selected, is written into a unix domain socket at /usr/local/var/run/bowdlator.sock.

You can write scripts (called filters) that connect to the socket and transform the input.

What could I use that for?

Check out the examples/ for sample filters. Following are currently included:

  • Bowdlerize.py: automatically censors a select number of English cuss words
  • Vulgarize.rb: automatically decensors a select number of English cuss words
  • caseFilter.c: suggests the uppercase, lowercase and normal version while typing. Your pinky will thank you for it
  • Encode.pl: Allows using an arbitary Perl Encode module for filtering all entered words.
  • TeX-Encode: Translates a good chunk of \texnotation into Unicode. You enter tex-mode by \ and leave it by pressing a non-printable key
  • Encode-Arabic-Franco: Translates Franco-Arabic/Arabizy/Chat-Arabic (a transliteration using Latin and numbers) into actual Arabic script using the Encode::Arabic::Franco CPAN module

Why? and How?

Microsoft’s Cairo Research Lab wrote a fine piece of software called Maren, offering JIT transliteration to actual Arabic:

Unfortunately, such a program doesn’t exist for OS X, so I wrote this one. Prime goal was making it extensible by allowing arbitary filter scripts.

After connecting to the AF_UNIX socket, a nul-terminated string corresponding to the character typed will be sent. The filter then replies with the text to display and optionally a candidate list and/or a commit instruction (\4 ASCII ETX).

Sample filters in C, Perl, Python and Ruby are provided in examples/. If no filter is running, typed text is posted to the active process as is.

Install

  1. Download binary release HERE
  2. Extract it
  3. Copy it to ~/Library/Input Methods or /Library/Input Methods
  4. Logout and Login (shift+command+Q)
  5. Open Keyboard Preferences ❯ Input Sources ❯ + ❯ Search Bowdlator
  6. Start appropriate filter

Building from source

  1. git clone http://github.com/a3f/bowdlator
  2. cd bowdlator
  3. make
  4. make install
  5. osascript -e 'tell app "System Events" to «event aevtrlgo»'
  • Open Keyboard Preferences ❯ Input Sources ❯ + ❯ Search Bowdlator
  • Start appropriate filter

Copyright (C) 2016 Ahmad Fatoum

The InputMethod is free software; you can redistribute it and/or modify
it under the terms of the GNU GPL3+. See LICENSE for the full terms. Additionally, the examples/ are in the public domain.

Logo by Islam Negm.