「Sdcv」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(→‎sdcv エイリアス: 記事を削除)
(→‎辞書の追加: 記事を更新)
18行目: 18行目:
 
== 辞書の追加 ==
 
== 辞書の追加 ==
   
  +
There are various places on the web where you can download StarDict dictionaries (e.g. https://web.archive.org/web/20200702000038/http://download.huzheng.org/).
ウェブ上の様々なところに StarDict 辞書をダウンロードできるサイトがあります。例:
 
   
  +
Once you have the appropriate files you can extract them into {{ic|/usr/share/stardict/dic}}.
* http://abloz.com/huzheng/stardict-dic/dict.org
 
* http://abloz.com/huzheng/stardict-dic/freedict.de
 
* http://abloz.com/huzheng/stardict-dic/mova.org
 
* http://abloz.com/huzheng/stardict-dic
 
   
  +
If you do not have root permission, you can set the {{ic|STARDICT_DATA_DIR}} [[environment variable]]:
ファイルをダウンロードしたら {{ic|/usr/share/stardict/dic}} に展開してください。
 
   
  +
STARDICT_DATA_DIR=$XDG_DATA_HOME
root 権限がない場合は {{ic|STARDICT_DATA_DIR}} [[環境変数]]でディレクトリを設定できます。例:
 
   
  +
sdcv will look in the {{ic|dic}} subdirectory so make sure that it is created and then place your dictionary files inside it.
export STARDICT_DATA_DIR=$XDG_DATA_HOME
 
   
  +
If all is done correctly, sdcv should be able to output definitions for words passed into it.
sdcv は {{ic|dic}} サブディレクトリを検索するので設定したディレクトリの中に作成しておいてください。
 
   
 
== ヒントとテクニック ==
 
== ヒントとテクニック ==

2023年7月11日 (火) 10:44時点における版

sdcv はコマンドライン辞書ツールです。StarDict 形式の辞書を使うことができます。

インストール

公式リポジトリから sdcv パッケージをインストールしてください。

使用方法

sdcv はコマンドラインから起動できます:

$ sdcv

シェルのようなコマンドラインが開いてデータベースを検索できます。

辞書の追加

There are various places on the web where you can download StarDict dictionaries (e.g. https://web.archive.org/web/20200702000038/http://download.huzheng.org/).

Once you have the appropriate files you can extract them into /usr/share/stardict/dic.

If you do not have root permission, you can set the STARDICT_DATA_DIR environment variable:

STARDICT_DATA_DIR=$XDG_DATA_HOME

sdcv will look in the dic subdirectory so make sure that it is created and then place your dictionary files inside it.

If all is done correctly, sdcv should be able to output definitions for words passed into it.

ヒントとテクニック

出力フォーマット

sdcv のラッパーを使用すると、その出力 (Source) を簡単にフォーマットできます。

function def() {
	sdcv -n --utf8-output --color "$@" 2>&1 | \
	fold --width=$(tput cols) | \
	less --quit-if-one-screen -RX
}

環境変数は、ラッパーを必要とせずに同様の書式設定機能を実現でき、sdcv のすべての通常の呼び出しに影響します。

SDCV_PAGER='less --quit-if-one-screen -RX'

パイプも機能します:

SDCV_PAGER='lolcat -f | less --quit-if-one-screen -RX'

参照