
Hope that helps anyone with this problem. To use the revised service highlight any Chinese characters and right click the context menu then on the bottom under the Services menu select "Convert to Pinyin". The format of the dictionary file is as a plain text file, each line of which is of the form. The first thing we’ll need to do in our little dictionary program is to load the dictionary into memory. To make the Service "live" just delete the "Ask for Text" and save the service with name of your choice (e.g. Loading the dictionary, part 1: Starting point.

To pay it forward for the folks who've helped, especially here is the Solution for taking the command utility and converting it to a MacOSX service that can be used to translate Chinese characters to pinyin.Ĭreate a new Automator Service file and make sure to select output replaces selected text.Īutomator Script details PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin/: FEATURES Translate in more than 110 languages Translate big blocks of text in one click. The application can work with no internet connection.
MAC DICTIONARY FILE TRADITIONAL CHINESE PDF
Next I will just create a Service to call the utility from Automator against selected text. Translate text, voice, images, PDF files and websites in more than 110 languages. The github for the utility can be found at Please see the accepted answer below for extended references. I've tried the following, which is not returning any results: find. I would like to parse that file for a UTF-8 string (maybe Chinese character double bytes) and return the lines where the string is found. The dictionaries are MacOSX packages and all have a Contents folder that contains a file called Body.data.

I would like to parse them to obtain dictionary results programmatically (via Terminal, AppleScript, or Automator).

MacOSX comes with dictionaries stored in /Library/Dictionaries.
