{"id":107828,"date":"2020-01-22T08:00:00","date_gmt":"2020-01-22T08:00:00","guid":{"rendered":"https:\/\/fedoramagazine.org\/?p=29917"},"modified":"2020-01-22T08:00:00","modified_gmt":"2020-01-22T08:00:00","slug":"set-up-an-offline-command-line-dictionary-in-fedora","status":"publish","type":"post","link":"https:\/\/sickgaming.net\/blog\/2020\/01\/22\/set-up-an-offline-command-line-dictionary-in-fedora\/","title":{"rendered":"Set up an offline command line dictionary in Fedora"},"content":{"rendered":"<p>You don&#8217;t need an internet connection to have an easily searchable and extendable dictionary on your Fedora computer. You can use <em>sdcv<\/em> (StarDict under Console Version) and the public Stardict files on the default repositories to keep a local record for offline use. This article shows you how.<\/p>\n<p> <span id=\"more-29917\"><\/span> <\/p>\n<h2 id=\"what-is-sdcv\">What is sdcv?<\/h2>\n<p>sdcv is a command line variant of Stardict. Stardict is a part of a long legacy of GUI offline dictionaries. The &#8220;dic&#8221; files it uses are formatted as a colon delimited file, with the word in first column and the definition in the second column. You can have multiple lines with the same word and different definitions. <em>sdcv<\/em> will provide you with a search function and formatted display of your results.<\/p>\n<h2 id=\"installing-sdcv\">Installing sdcv<\/h2>\n<p>You can get started quickly with <em>sdcv<\/em> and the English dictionary by installing them from the default repos:<\/p>\n<pre class=\"wp-block-preformatted\">sudo dnf install sdcv stardict-dic-en<\/pre>\n<p><em>sdcv<\/em> will be ready for use right away. If you want to see what other languages are available, use&nbsp;this command:<\/p>\n<pre class=\"wp-block-preformatted\">dnf search stardict<\/pre>\n<h2 id=\"how-to-use-sdcv\">How to use sdcv<\/h2>\n<p><em>sdcv<\/em> has an interactive and non-interactive mode. You can perform a quick search on a word or term using this command:<\/p>\n<pre class=\"wp-block-preformatted\">sdcv <em>word<\/em><\/pre>\n<p>For example, you could search <em>sdcv linux<\/em>. Alternately, you can run <em>sdcv<\/em> by itself to activate interactive mode.<\/p>\n<h2 id=\"customizing-sdcv\">Customizing sdcv<\/h2>\n<p><em>sdcv<\/em> has a <em>&#8211;color<\/em> option that adds coloring to the words and source of the definition. You can also use an alias to enable <em>&#8211;color<\/em> by default. Simply edit your <a href=\"https:\/\/fedoramagazine.org\/manage-your-shell-environment\/\">shell resource file<\/a> (default on Fedora is <em>~\/.bashrc<\/em>) to add this command:<\/p>\n<pre class=\"wp-block-preformatted\">alias sdcv=\"sdcv --color\"<\/pre>\n<p>You can also use a more friendly name like this:&nbsp;<\/p>\n<pre class=\"wp-block-preformatted\">alias describe=\"sdcv --color\"<\/pre>\n<p><em>sdcv<\/em> references <em>\/usr\/share\/stardic\/dic<\/em> by default, or it uses the path located in the shell variable <em>STARDICT_DATA_DIR<\/em>. You can also set up a personal dictionary in the file <em>$HOME\/.stardict\/dic<\/em>.<\/p>\n<h2>Fun facts<\/h2>\n<p>Believe it or not, the <a href=\"https:\/\/tools.ietf.org\/html\/rfc2229\">dict network protocol<\/a> is still alive to this day. You can use it with the <em>curl<\/em> command by using a command like this to search for a word:<\/p>\n<pre class=\"wp-block-preformatted\">curl dict:\/\/dict.org\/d:&lt;word&gt;<\/pre>\n<p>This pull definitions straight from the internet via your command line. Enjoy using <em>sdcv<\/em>!<\/p>\n<hr class=\"wp-block-separator\" \/>\n<p><em>Photo by\u00a0<a href=\"https:\/\/unsplash.com\/@pisitheng?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\">Pisit Heng<\/a>\u00a0on\u00a0<a href=\"https:\/\/unsplash.com\/s\/photos\/dictionary?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\">Unsplash<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You don&#8217;t need an internet connection to have an easily searchable and extendable dictionary on your Fedora computer. You can use sdcv (StarDict under Console Version) and the public Stardict files on the default repositories to keep a local record for offline use. This article shows you how. What is sdcv? sdcv is a command [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[89,876,606,45,877,46,47,878,275,685,44,678],"class_list":["post-107828","post","type-post","status-publish","format-standard","hentry","category-fedora-os","tag-command-line","tag-dictionary","tag-faqs-and-guides","tag-fedora","tag-lookup","tag-magazine","tag-news","tag-text","tag-tools","tag-useful-tools","tag-using-software","tag-utilities"],"_links":{"self":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/107828","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/comments?post=107828"}],"version-history":[{"count":0,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/107828\/revisions"}],"wp:attachment":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media?parent=107828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/categories?post=107828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/tags?post=107828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}