嘛。懶得寫介紹,直接把 readme 拖過來了。目前 Homebrew 還沒 merge ,請自行編譯安裝。在 Mac 上運行完了就可以直接通過 iCloud 同步到所有設備上去了。
E 一個畫圖喵一年多沒寫代碼了,就這些,將就著用吧。
很慚愧,做了一點微小的貢獻,謝謝大家。
功能:
建議運行的時候加上 -i 參數把所有的注音都重新設定,如果聯繫人只有中國人的話,可以加上 -j 和 -k 忽略掉日本語和韓語。
關於實現方式:
Add phonetic names to contacts. Supports all CJK characters and multiple formats.
With Homebrew:
$ brew install contacts-phonetic
Compile on your own:
$ git clone https://github.com/Elethom/ContactsUtil-PhoneticName.git
$ cd ContactsUtil-PhoneticName
$ make install
-i, --ignore-existing
    Ignore existing phonetic names. Use of this option will update all person entries in the address book.
-m, --keep-marks
    Keep accents and diacritcs.
-s, --keep-spaces
    Keep spaces between characters.
-c, --ignore-chinese
    Ignore Chinese. (Will use Japanese Romaji if both are possible.)
-j, --ignore-japanese
    Ignore Japanese. (Will use Chinese Pinyin if both are possible.)
-k, --ignore-korean
    Ignore Korean.
Example:
$ contacts-phonetic
--------------------
Alice Alstromeria
--------------------
Dieter Rams
--------------------
Elethom Alstromeria
--------------------
ことり 椎名
椎名 1. Japanese (shiina); 2. Chinese (chuí míng). Select: Select: 1
Kotori Shiina
--------------------
直人 深澤
直人 1. Japanese (naoto); 2. Chinese (zhí rén). Select: Select: 1
深澤 1. Japanese (fukazawa); 2. Chinese (shēn zé). Select: Select: 1
Naoto Fukazawa
--------------------
研哉 原
研哉 1. Japanese (ken'ya); 2. Chinese (yán zāi). Select: Select: 1
原 1. Japanese (hara); 2. Chinese (yuán). Select: Select: 1
Ken'ya Hara
--------------------
This code is distributed under the terms and conditions of the MIT license.
You can support me by:
:-)
|  |      1wbsdty331      2016-02-02 22:38:47 +08:00 强行膜 | 
|  |      2jjgod      2016-02-02 22:42:10 +08:00 | 
|  |      449      2016-02-02 22:52:58 +08:00 via iPhone 一个人的命运啊,当然要靠自我奋斗。但也要考虑历史的进程。 你写的这个工具啊, excited !刚好要用到! | 
|  |      5xhacker      2016-02-03 00:56:53 +08:00 `--ignore-existing` 和 `--ignore-(chinese|japanese|korean)` 似乎语义是反的? | 
|  |      6xhacker      2016-02-03 00:59:48 +08:00 另外: 潇袆 李 Xiāohuī Lǐ 这是个 bug 么…… | 
|  |      7Elethom OP | 
|  |      9xhacker      2016-02-03 08:03:50 +08:00 加 -k 参数就不干活了。似乎 https://github.com/Elethom/ContactsUtil-PhoneticName/blob/master/src/main.m#L107-L109 这里有点问题? | 
|  |      10ppwangs      2016-02-03 08:35:24 +08:00 现在的孩子们连汉字都不认得了,需要注音了吗? | 
|  |      12imn1      2016-02-03 09:09:39 +08:00 注音还是拼音?大陆这边懂注音的恐怕不多 | 
|  |      14Elethom OP | 
|  |      15Elethom OP @xhacker  $ brew audit contacts-phonetic --online contacts-phonetic: * GitHub repository not notable enough (<10 forks, <10 watchers and <20 stars) * GitHub repository too new (<30 days old) Error: 2 problems in 1 formula CI 失敗。 😭 | 
|  |      16xhacker      2016-02-03 11:51:13 +08:00 @xhacker: 「 Ignore existing phonetic names. Use of this option will update all person entries in the address book.」你这两句话似乎是自相矛盾的? | 
|  |      17Elethom OP @xhacker  並沒有呀。忽略掉已經存在的 phonetic names 不就是不管原來有沒有全部都更新嗎。默認的話是會檢查是否存在的,存在即跳過。 | 
|  |      18zander      2016-02-03 13:33:59 +08:00 Absolutely great job. 几天前我还在那个帖子里提到日文名字的发音问题, LZ 行动力挺高的。 不过 CFStringTokenizer 对日文支持不是很好,例如 相哲 soutetsu 就会认成 aiakira 。不过我也没找到更好的方法,就把项目搁置了。反正我添加联系人的机会也不多。 | 
|  |      19won      2016-02-03 13:49:12 +08:00 via Android 小爱桑好厉害哦 | 
|  |      22xhacker      2016-02-03 14:18:54 +08:00 @Elethom: 哦哦,这个意思……「 Ignore existing phonetic names 」我第一反应是忽略已经存在的名字不处理…… | 
|  |      25blueset      2016-02-06 21:37:06 +08:00 提个建议: 关于 -i 的说明,可以改成 Overwrite existing phonetic names. 顺便问一下,这个工具可以用于 Google Contact 吗? |