isearch

有道词典 命令行查询 柯林斯词典 单词管理 本地保存

https://github.com/louisun/isearch

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.1%) to scientific vocabulary

Keywords

dictionary word youdao
Last synced: 6 months ago · JSON representation

Repository

有道词典 命令行查询 柯林斯词典 单词管理 本地保存

Basic Info
  • Host: GitHub
  • Owner: louisun
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 634 KB
Statistics
  • Stars: 233
  • Watchers: 14
  • Forks: 49
  • Open Issues: 1
  • Releases: 0
Topics
dictionary word youdao
Created almost 10 years ago · Last pushed 9 months ago
Metadata Files
Readme License

README.md

iSearch

iSearch是一款命令行 单词查询单词管理 工具, 内容来自网易有道词典

  • v1.0.0 #9b5bd2b 兼容 Python2、Python3
  • v1.0.2 #4ffdeee 优化查询流程:查询后会自动提示是否存入本地
  • v1.0.2 with readme #06013d6
  • v1.0.4 #af232b8 追加config file功能
  • v1.0.5 追加proxy功能,在~/.config/iSearch/iSearch.txt 配置 PROXY
  • v1.0.6 追加dockerfile

安装与设置

原版 pip install iSearch

Fork Version pip install git+https://github.com/candywater/iSearch


配置文件位置

./iSearch.txt # source file folder ~/.iSearch/iSearch.txt # default path ~/.config/iSearch/iSearch.txt /etc/iSearch/iSearch.txt $ISEARCH_CONF/iSearch.txt # system environment parameter

配置文件(例子)

INI SHOW_SAVE_DB_CONFIRM_MESSAGE = False DEFAULT_SAVE_DB_LEVEL = 3 PROXY = 127.0.0.1:7890

DockerFile (for debug)

docker build --tag 'isearch' . docker run --rm isearch cool

简介

内容包括【柯林斯词典】、【词组】、【同近义词】、【词语辨析】、【其他例句】,每个单词不一定都有以上各项内容。

其他功能有:

  • 在本地 sqlite 数据库中添加单词、删除单词
  • 对数据库中的单词设置优先级
  • 按照首字母优先级范围添加时间列出单词
  • 从文本文件中批量添加单词到数据库
  • 颜色高亮(也可关闭,方便导出到文本文件)
  • 可以是词组和中文
  • 从数据库查询时,可以只输入单词的首部。
  • 查看每个字母、优先级的单词数目。

注: 普通查询,会先在本地数据库查找,若数据库中没有才从网页查找。

初次使用,请先查一个单词,比如s hello,以创建目录和数据库。

数据库文件等在~/.iSearch目录下。

使用方法

usage: s [-h] [-f FILE] [-a ADD [ADD ...]] [-d DELETE [DELETE ...]] [-s SET] [-v] [-o] [-p PRIORITY] [-t TIME] [-l LETTER] [-c COUNT] [word [word ...]]

参数说明:

无额外参数 直接查词

-f --file 从文本文件添加单词列表到数据库

-a --add 添加单词

-d --delete 删除单词

-p --priority 根据优先级列出单词

-t --time 列出最近加入的n个单词

-l --catalog 列出A-Z开头的单词目录

-s --set 设置单词的优先级

-v --verbose 查看详细信息

-o -output 输出模式

直接查询

bash s sun

```text sun 不在数据库中,从有道词典查询 sun /sʌn/

N-SING The sun is the ball of fire in the sky that the Earth goes around, and that gives us heat and light. 太阳

例: The sun was now high in the southern sky. 太阳当时正高挂在南面天空上。

例: The sun came out, briefly. 太阳出来了,时间很短。

  1. N-UNCOUNT You refer to the light and heat that reach us from the sun as the sun . 阳光

例: Dena took them into the courtyard to sit in the sun. 德娜把他们带到院子里坐在阳光下。

【词组】

in the sun 在阳光下,无忧无虑

under the sun 天下;究竟

with the sun 朝着太阳转动的方向,顺时针方向

sun yat-sen n. 孙逸仙

see the sun 活着;出生;发现太阳的耀眼

setting sun 落日;斜阳

morning sun 朝阳

...

【同近义词】

n. [天]太阳

sonne

vi. [天]晒太阳

bask ```

从文本文件添加单词到数据库

``` s -f [文件绝对路径]

下面输入default默认为配置目录下的word_list.txt文件

s -f default

```

逐个添加单词到数据库 (默认优先级为 1)

``` s -a sun

sun has been inserted into database

```

从数据库中删除

``` s -d [单词]

sun has been deleted from database ```

设置优先级 (1 到 5)

``` s -s 3 sun

the priority of sun has been reset to 3

```

根据优先级(1 到 5)列出单词

```bash

非verbose模式, 只输出优先级和单词

-v --verbose 模式, 输出详细意思

非output模式, 命令行多色

-o --output 模式, 非多色输出, 可以重定向到文件

列出优先级为1的单词

s -p 1

列出优先级大于2的单词

s -p 2+

列出优先级为2-3的单词

s -p 2-3 ```

列出最近添加的 n 个单词 (time)

```bash

非verbose模式, 只输出优先级和单词

-v --verbose 模式, 输出详细意思

非output模式, 命令行多色

-o --output 模式, 非多色输出, 可以重定向到文件

s -t 10 ```

列出以 a-z 开头的所有单词

```bash

非verbose模式, 只输出优先级和单词

-v --verbose 模式, 输出详细意思

非output模式, 命令行多色

-o --output 模式, 非多色输出, 可以重定向到文件

s -l a ```

计数

```bash

列出以 a 字母开头的单词数目

s -c a

列出优先级为 3 的单词数目

s -c 3

列出优先级大于 3 的单词数目

s -c 3+

列出优先级为 2-3 的单词数目

s -c 2-3

列出全部单词数目

s -c all ```

FAQ

常见问题:

默认命令是s,若被其他程序使用,可将iSearch目录下相应文件alias为其他名字。

如果找不到s 命令,请看以下内容,否则跳过:

Linux 下默认 pip 可能将包安装到~/.local/lib/python3.6 下,s 可执行文件会放在~/.local/bin 下。

如果没将~/.local/bin 放入PATH, 可能会导致找不到命令。

提示找不到s命令的可在的~/.bashrc~/.zshrc中加入这行:

bash export PATH="$PATH:$HOME/.local/bin"

tips

如果你嫌每次滚动很多屏,要翻上去才能看麻烦,配合less 命令翻滚查看

可选择将下面的函数放在.bashrc.zshrc中(不适用于最新版,适用于1.0.0版)

bash function s(){ local spath="你的 s 命令路径" # 可用 which s 查看, 比如 ~/.local/bin/s if [[ ${1:0:1} != '-' ]] then $spath $* | less else $spath $* fi }

LICENSE

MIT

Owner

  • Name: Renzo
  • Login: louisun
  • Kind: user

Consistent

GitHub Events

Total
  • Issues event: 1
  • Watch event: 5
  • Delete event: 1
  • Issue comment event: 2
  • Push event: 2
  • Pull request event: 5
  • Fork event: 1
  • Create event: 1
Last Year
  • Issues event: 1
  • Watch event: 5
  • Delete event: 1
  • Issue comment event: 2
  • Push event: 2
  • Pull request event: 5
  • Fork event: 1
  • Create event: 1

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 65
  • Total Committers: 7
  • Avg Commits per committer: 9.286
  • Development Distribution Score (DDS): 0.615
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
louisun r****n@1****m 25
birdFSS f****4@1****m 22
xiangyufan x****n@j****n 12
louisun l****n 3
haishenmingx@gmail.com W****7 1
Your Name y****u@e****m 1
birdFSS 5****S 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 11
  • Total pull requests: 10
  • Average time to close issues: 6 months
  • Average time to close pull requests: 2 days
  • Total issue authors: 9
  • Total pull request authors: 6
  • Average comments per issue: 2.0
  • Average comments per pull request: 1.2
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 0
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: 4 days
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • candywater (3)
  • atusoft (1)
  • AndySze (1)
  • xplorld (1)
  • rongwwei (1)
  • RogueAndMagic (1)
  • leitro (1)
  • NamelessAshone (1)
  • freestyledash (1)
Pull Request Authors
  • candywater (4)
  • dependabot[bot] (4)
  • birdFSS (3)
  • haishenming (1)
  • floydScript (1)
  • penn201500 (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (4) python (2)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 9 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 6
  • Total maintainers: 1
pypi.org: isearch

有道词典单词查询、存储和管理的命令行工具

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 9 Last month
Rankings
Stargazers count: 4.6%
Forks count: 6.0%
Dependent packages count: 10.0%
Average: 13.8%
Dependent repos count: 21.7%
Downloads: 27.0%
Maintainers (1)
Last synced: 6 months ago

Dependencies

setup.py pypi
  • bs4 *
  • requests *
  • termcolor *
.github/workflows/python-dry-run.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
Dockerfile docker
  • python 3.11-alpine build