1. 主页 > 世界杯2021 >

hallelujahIM

中文版 | English Version

哈利路亚英文输入法

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

离线词库较大较全,词频精准。参见 Google's 1/3 million most frequent English words.

内置拼写校正功能。不用担心拼写错误,能记住大概字形、发音,本输入法就会自动显示最可能的候选词。

具备 Text-Expander 功能。 本输入法会自动读取定义在用户目录下的~/.you_expand_me.json 文件,你可以定义自己常用的词组,比如 {"yem":"you expand me"},那么当输入 yem 时会显示 you expand me 。

即时翻译功能(显示音标,及英文单词的中文释义)。

支持按拼音来输出对应英文。如输入suanfa,输入法会候选词中会显示 algorithm。

支持按英文单词的模糊音来输入。 如输入 cerrage 或者 kerrage 可以得到 courage 候选词,也可以输入 aosome 或者 ausome 来得到 awesome 候选词。

按键盘右侧shift 键可以在智能英语输入模式与传统英语输入模式间切换。

选词方式:数字键 1~9 及 Enter 回车键和 Space 空格键均可选词提交。Space 空格键选词默认会自动附加一个空格在单词后面,可以在配置页面关闭自动附加空格功能。Enter 回车键选词则不会附加空格。

下载与安装

下载编译好的输入法应用(注意:不要点击 "Clone or download",要从下面的链接下载 pkg 文件或者 exe 文件)

macOS 10.12 及以上版本: 下载 最新版 : https://github.com/dongyuwei/hallelujahIM/releases/latest 下载 pkg 自动安装文件

macOS 10.9 ~ 10.11 老版本(Deprecated version): https://github.com/dongyuwei/hallelujahIM/releases/tag/v1.1.1 需要手动安装 app 文件

Windows 版本: 基于 PIME 移植到 Windows 平台,https://github.com/dongyuwei/Hallelujah-Windows/releases 下载 exe 安装文件

Linux:https://github.com/fcitx-contrib/fcitx5-hallelujah 感谢Qijia Liu!

Android: https://github.com/dongyuwei/Hallelujah-Android

打开下载后的 hallelujah .pkg 文件,会自动安装、注册、激活哈利路亚输入法。

如果输入法不能正常使用,请退出当前用户重新登录,在 Input source 中手动添加 Hallelujah 输入法。

image

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

为什么叫 hallelujah 这个名字?

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

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

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

偏好设置

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

编译本输入法

open hallelujah.xcworkspace 使用 Xcode 打开 hallelujah.xcworkspace 工程,注意不是打开 hallelujah.xcodeproj。

command + b 构建.

构建编译后的输入法可以拷贝到 /Library/Input\ Methods/ 目录内测试。

如何调试输入法?

使用 NSLog() 在关键或可疑处打 log 日志。

没有 log 输出时,可以查看崩溃日志,位置可通过 ls -l ~/Library/Logs/DiagnosticReports/ | grep hallelujah 命令来查找。

深思熟虑。

使用 debug 版 build,在 Xcode 中 Debug -> Attach to Process By PID or Name... 。这个流程可以 work,但 Xcode 反应会较慢,需要在合适的地方加断点。大杀器,不得已而用之。

自动化测试(后续重构目标就是可测试性要加强)。

格式化代码

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

The static libmarisa.a lib was built from marisa-trie @006020c1df76d0d7dc6118dacc22da64da2e35c4.

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.

感谢以下开源项目:

marisa-trie,输入时前缀匹配的数据结构及算法实现,特点是高性能、节省空间,可以预先构建好 trie 树再反序列化到内存中。

dictionary/cedict.json is transformed from cc-cedict,拼音-英语词库。

cmudict and https://github.com/mphilli/English-to-IPA, 国际音标。

GCDWebServer,用于用户使用偏好配置。

talisman,使用其中的 phonex 算法,实现模糊近似音输入。

MDCDamerauLevenshtein,配合 talisman 的 phonex 算法,在音似词中按 Damerau Levenshtein 编辑距离筛选最接近的候选词。

鼠鬚管 squirrel 输入法 哈利路亚输入法安装包 pkg 的制作 copy/参考了 squirrel 的实现。

贡献代码

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

问题反馈,意见和建议

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

咨询服务

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

微信: dongyuwei

gmail: newdongyuwei

一些截图

auto suggestion from local dictionary:

Text Expander:

translation(inspired by MacUIM):

spell check:

pinyin in, English out:

Star History