Giter Club home page Giter Club logo

alfred-dict-workflow-python3's Introduction

Alfred 查词扩展

多功能、快速、易用的 Alfred 查词扩展。

请到 release 页面下载最新的 workflow,双击安装。

为了使用方便,请设置取词快捷键。

使用系统内置牛津词典

由于每次更新 macOS 词典格式都会改变,最新版本不保证可用,旧版本支持也将移除。

当前版本仅支持 10.13。10.13 以下系统请使用旧版本 workflow。

先打开 Dictionary.app,安装牛津英汉汉英词典。

然后安装 lxml :

command -v pip3 || sudo easy_install pip3
sudo pip3 install lxml

简介

  • 支持的词典:
    • 系统词典,支持朗道、牛津词典
    • 有道在线词典
    • 爱词霸在线词典
    • 百度在线词典
    • 必应在线词典
    • 海词在线词典
  • 支持英汉、汉英互查
  • 支持音标,默认显示美式音标
  • 使用系统 TTS 引擎发音
  • 可快速复制释义
  • 可使用快捷键进行词典切换
  • 缓存查询结果,方便下次查询
  • 支持快捷键取词
  • 支持自定义配置

截图

screenshot

查词

查词:

cc {word} @ {dict}

词典代号:

词典 代号
系统内置牛津词典(需要 lxml) nj, oxford
朗道本地词典(需下载) ld, landau
有道在线词典 yd, youdao
爱词霸在线词典 cb, iciba
百度在线词典 bd, baidu
必应在线词典 by, bing
海词在线词典 hc, dictcn

注:

  • 关键词默认为 cc(即查词),可通过配置文件修改。
  • 每个词典有长短两个代号,短的代号为拼音缩写,便于记忆,长的代号为全称。
  • 可以为每个词典启用一个切换快捷键,////fn + ,可通过配置文件修改。
  • 朗道词典非系统内置,请先下载,然后复制到 ~/Library/Dictionaries/ 目录。
  • 由于必应、海词没有提供 API,只能通过解析 HTML 得到,因此速度可能稍慢(已优化)。

内部命令

查看内部命令:

cc :
命令 功能
clean 清除所有缓存
config 编辑配置文件(json 格式)
update 修改配置文件的某些项后需要更新才能生效

建议每次修改配置文件后,执行一次 update,确保生效。

配置文件

配置文件为 json 格式,目前有以下选项:

  • "keyword": 关键字,默认为 "cc"。
  • "default": 默认词典,即省略 @ {dict} 时使用的词典,默认为"nj"。
  • "keymap": 键绑定,修改切换词典快捷键,支持以下修饰键:
    • "none": 直接回车时的行为,可取 "open" 或 "say":
      • "open":打开详细解释页面(浏览器或系统词典)。
      • "say":发音,目前只支持系统 tts 引擎。
    • "ctrl/alt/shift/cmd/fn": 词典代号,长短皆可。
  • "options": 词典相关的选项,一般不用修改。
    • "dictcn": 海词词典选项:
      • "wap_page": 是否使用 wap 页面查词,wap 页面信息较少,默认为 "false"。
  • "cache": 缓存相关的设置。
    • "enable": 打开或关闭缓存,默认为 "true"。
    • "expire": 缓存失效时间,以小时为单位,默认为 "24"。

注:

  • 配置文件里同样有较详细英文注释,请修改之前务必了解每个选项的作用。
  • "keyword" 和 "keymap" 这两个选项修改完之后执行 update 才能生效。
  • 没有特殊需求,无需修改配置文件,保持默认即可。

LICENSE

GPL

alfred-dict-workflow-python3's People

Contributors

domainname avatar liberize avatar responsible avatar ryleysill93 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.