4

As the title says, I'm looking for a monolingual french dictionary that I can query on the commandline, ideally offline. For example to have a low latency way to check the gender of nouns.

I looked at the freedict language packs that are available for dictd via apt-get (on Ubuntu), but they all seem to be bilingual?

Does anyone have a suggestion?

1 Answer 1

3

On most repositories, there's sdcv, the console version of StarDict program.
Freely available dictionaries in StarDict format for offline use.

Use html2text to correct the dictionary's HTML output for reading at the console.

Set up an alias for easy lookup.

sdcvfr() {
  sdcv --data-dir="/path/to/french_file" --non-interactive "$1" | html2text --ignore-emphasis
}
alias sdf='sdcvfr'

Now, just type: sdf word

4
  • great! out of curiosity, are the same dictionaries also available for freedict? Or maybe sdcv is overall the better program anyway?
    – user313032
    Commented May 14 at 17:37
  • 1
    amd what's the point of using a function and an alias instead of just calling the function sdf?
    – user313032
    Commented May 14 at 18:30
  • 1
    @user313032 I believe the dictionary files are all compatible across FireDict, Color Dict, GoldenDict and StarDict. / You can't call the function directly from .bashrc without the alias. Maybe with export -f, but I'm not sure of that.
    – JayCravens
    Commented May 14 at 18:34
  • thanks! for me it worked without alias, I put the function in a file that is sourced in .bashrc. anyway, i ended up using sdf() { sdcv --data-dir="directory" --non-interactive --color "$1" | pandoc -f html -t plain | less } with pandoc instead of html2text since it gives nicer output. html2text didn't work at all without the option -utf8.
    – user313032
    Commented May 14 at 18:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .