HallelujahIM Save

hallelujahIM(哈利路亚 英文输入法) is an intelligent English input method with auto-suggestions and spell check features.

Project README

Platform:macOS Platform:windows Platform:linux github actions License: GPL v3

中文版 | English Version

哈利路亚英文输入法

哈利路亚英文输入法 是 Mac(10.9+ OSX)及 Windows 平台上一款智能英语输入法。其特性如下:

  1. 离线词库较大较全,词频精准。参见 Google's 1/3 million most frequent English words.
  2. 内置拼写校正功能。不用担心拼写错误,能记住大概字形、发音,本输入法就会自动显示最可能的候选词。
  3. 具备 Text-Expander 功能。 本输入法会自动读取定义在用户目录下的~/.you_expand_me.json 文件,你可以定义自己常用的词组,比如 {"yem":"you expand me"},那么当输入 yem 时会显示 you expand me
  4. 即时翻译功能(显示音标,及英文单词的中文释义)。
  5. 支持按拼音来输出对应英文。如输入suanfa,输入法会候选词中会显示 algorithm
  6. 支持按英文单词的模糊音来输入。 如输入 cerrage 或者 kerrage 可以得到 courage 候选词,也可以输入 aosome 或者 ausome 来得到 awesome 候选词。
  7. 按键盘右侧shift 键可以在智能英语输入模式与传统英语输入模式间切换。
  8. 选词方式:数字键 1~9 及 Enter 回车键和 Space 空格键均可选词提交。Space 空格键选词默认会自动附加一个空格在单词后面,可以在配置页面关闭自动附加空格功能。Enter 回车键选词则不会附加空格。

下载与安装

  1. 下载编译好的输入法应用(注意:不要点击 "Clone or download",要从下面的链接下载 pkg 文件或者 exe 文件)
  1. 打开下载后的 hallelujah .pkg 文件,会自动安装、注册、激活哈利路亚输入法。
  2. 如果输入法不能正常使用,请退出当前用户重新登录,在 Input source 中手动添加 Hallelujah 输入法。 image

注意:因为本程序不是通过 App store 发布的,Macos 会有下面的安全警告。选中 hallelujah pkg 安装程序,右键点击 Open 来打开,即可开始安装输入法。

unidentified

为什么叫 hallelujah 这个名字?

主要是受这篇文章启发: hallelujah_autocompletion.

少数派网友(@北堂岚舞)测评

英文拼写心里「没底」?这个输入法能把拼音补全为英文:哈利路亚输入法

偏好设置

点击输入法的 Preferences 或者直接访问本地 HTTP 服务: http://localhost:62718/index.html preference

编译本输入法

  1. open hallelujah.xcworkspace 使用 Xcode 打开 hallelujah.xcworkspace 工程,注意不是打开 hallelujah.xcodeproj
  2. command + b 构建.
  3. 构建编译后的输入法可以拷贝到 /Library/Input\ Methods/ 目录内测试。

如何调试输入法?

  1. 使用 NSLog() 在关键或可疑处打 log 日志。
  2. 没有 log 输出时,可以查看崩溃日志,位置可通过 ls -l ~/Library/Logs/DiagnosticReports/ | grep hallelujah 命令来查找。
  3. 深思熟虑。
  4. 使用 debug 版 build,在 Xcode 中 Debug -> Attach to Process By PID or Name... 。这个流程可以 work,但 Xcode 反应会较慢,需要在合适的地方加断点。大杀器,不得已而用之。
  5. 自动化测试(后续重构目标就是可测试性要加强)。

格式化代码

  • sh format-code.sh

CI build

sh build.sh

local dev script

sh dev.sh

构建安装包 pkg

bash package/build-package.bash

开源协议

GPL3(GNU GENERAL PUBLIC LICENSE Version 3)

构建 libmarisa.a

  1. The static libmarisa.a lib was built from marisa-trie @006020c1df76d0d7dc6118dacc22da64da2e35c4.
  2. To build the libmarisa.a lib, run:
git clone git://github.com/s-yata/marisa-trie.git
cd marisa-trie
brew install autoconf automake libtool -verbose ## proxychains4 -f /usr/local/etc/proxychains.conf brew install autoconf automake libtool -verbose
autoreconf -i
./configure --enable-static
make
## ls -alh lib/marisa/.libs/libmarisa.a
make install ## we can use marisa-build marisa-lookup marisa-reverse-lookup marisa-common-prefix-search marisa-predictive-search marisa-dump marisa-benchmark cli commands to do some tests and pre-build the trie data.

感谢以下开源项目:

  1. marisa-trie,输入时前缀匹配的数据结构及算法实现,特点是高性能、节省空间,可以预先构建好 trie 树再反序列化到内存中。
  2. dictionary/cedict.json is transformed from cc-cedict,拼音-英语词库。
  3. cmudict and https://github.com/mphilli/English-to-IPA, 国际音标。
  4. GCDWebServer,用于用户使用偏好配置。
  5. talisman,使用其中的 phonex 算法,实现模糊近似音输入。
  6. MDCDamerauLevenshtein,配合 talisman 的 phonex 算法,在音似词中按 Damerau Levenshtein 编辑距离筛选最接近的候选词。
  7. 鼠鬚管 squirrel 输入法 哈利路亚输入法安装包 pkg 的制作 copy/参考了 squirrel 的实现。

贡献代码

提交 PR 之前请执行 sh format-code.sh 格式化代码。

问题反馈,意见和建议

请提交问题单到 https://github.com/dongyuwei/hallelujahIM/issues

咨询服务

提供输入法功能定制开发。联系方式:

  • 微信: dongyuwei
  • gmail: newdongyuwei

一些截图

auto suggestion from local dictionary:
auto-suggestion auto-suggestion auto-suggestion

Text Expander:
Text Expander Text Expander

translation(inspired by MacUIM):
translation

spell check:
spell-check spell-check spell-check spell-check spell-check

pinyin in, English out:
pinyin pinyin pinyin pinyin pinyin pinyin

Star History

Star History Chart

Open Source Agenda is not affiliated with "HallelujahIM" Project. README Source: dongyuwei/hallelujahIM

Open Source Agenda Badge

Open Source Agenda Rating