Git Product home page Git Product logo

kictor's Introduction

Kictor

Online dictionary based on the console, 基于控制台的在线词典, 兼容 Python2 和 Python3。

功能简介

  • 支持有道词典、百度翻译、爱词霸三个 API 接口查词;
  • 支持单词发音;
  • 支持划词查询;
  • 支持输出爱词霸每日一句.
-b, --baidu      Select baidu api.
-i, --iciba      Select iciba api.
-d, --daysay     Print daily sentence of iciba.
-o, --resources  Print online web resources.
-s, --speech     Print URL to speech audio.
-r, --read       Read out the word, use festival on Linux.
-x, --selection  Show explaination of current selection.

注: 有道接口功能相对较全,所以默认的查词接口是有道。百度翻译结果太粗糙,爱词霸不支持句子翻译,但是单词的翻译还是很完美的。可以根据需要选择合适的接口。

控制台模式

如果不输入任何查询内容,则默认启动控制台查词模式。在控制台模式下支持执行 shell 命令,但需要加上 ! 前缀,同时支持切换查词接口:

  • @select_youdao_api 切换到有道翻译
  • @select_baidu_api 切换到百度翻译
  • @select_iciba_api 切换到爱词

当输入 @exit@quit 或者 Ctrl+D 时退出控制台模式,输入 @help 可以查看帮助。

每日一句

  • kict -d 输出爱词霸的每日一句,

依赖的系统工具

  • xclip 用于划词查询
  • festival 用于单词发音

Debian/Ubuntu 安装:

apt-get install xclip

apt-get install festival

安装与使用

克隆本项目到本地,然后进入项目目录执行:

ln -s $PWD/kict.py /usr/bin/kict

或者

cp $PWD/kict.py /usr/bin/kict

注: 使用需保证系统有 Python 环境,且版本大于 2.6。

更新日志

2018.01.23

  • 使用标准库 cmd 模块重写控制台模式
  • 控制台模式每次查完次之后手动执行一次内存回收

2018.01.22

  • 用 urllib 库代替 requests 库,不再依赖任何第三方库
  • 修正部分代码风格

Huoty 2016-10-18

kictor's People

Contributors

kuanghy avatar

Watchers

James Cloos 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.