Skip to content

Commit

Permalink
fix oxford dict name
Browse files Browse the repository at this point in the history
  • Loading branch information
liberize committed Oct 22, 2015
1 parent a6e686a commit 1923473
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dict - Lookup Word/cndict/oxford.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@


def lookup(word, external_cmd=True, parse_html=True, *args):
mac_ver = StrictVersion(platform.mac_ver()[0])

if external_cmd:
cmd = '{}/{}'.format(os.path.dirname(os.path.realpath(__file__)), 'systemdict')
if os.path.isfile(cmd) and os.access(cmd, os.X_OK):
dict_name = '牛津英汉汉英词典'
dict_name = '牛津英汉汉英词典' if mac_ver >= StrictVersion('10.10') else 'Oxford Chinese Dictionary'
proc = subprocess.Popen([cmd, '-t', 'html' if parse_html else 'text', '-d', dict_name, word],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
definition = proc.stdout.read()
Expand All @@ -39,7 +41,6 @@ def lookup(word, external_cmd=True, parse_html=True, *args):

result = []
is_eng = is_english(word)
mac_ver = StrictVersion(platform.mac_ver()[0])

part_map = {
'noun': 'n.',
Expand Down

0 comments on commit 1923473

Please sign in to comment.