the foss alternative to googling words
did you know: googling is a better word than searching⌗
There is a legend that I heard that Google does not want its users to say the word “Google” as a verb because it’d make the word so general, they’d lose their trademark.
intro⌗
I have this nasty habit of opening up “google.com” in-order to check my spelling of a word and a definition. I use a text editor without an installed dictionary engine and sometimes, I mispell. I also use words that mean things other than what I think they mean.
the alternative: stardict dictionaries⌗
Stardict dictionaries are files in-which there are a bunch of words and their type, definition, examples, et cetera. You can find stardict dictionaries online for free. I happen to gotten mine from this page but you can find other dictionaries for other languages too.
what programs can I use?⌗
I personally use sdcv
in-order to check definitions. The cool thing is that it displays pronouncitation, type of a word(verb, adjective or noun), definition, et cetera.
I really like it. You can also use something like aspell
or ispell
. They have their merits, I just use sdcv
because it contains enough good features and 0 bad features that I hate.
wordlist: find words⌗
The .dict.dz
file format, the format of stardict files, is really simple. It is a file that contains words in XML
compressed using the deflate
compression algorithm. One good thing you’d get from learning awk
is that you can hack up a script to parse a file format such as the one used by stardict files.
Check the following script out:
zcat eng_eng_main.dict.dz | awk 'match($0, /<k[^>]*>.*<\/k[^>]*>/) { print substr($0, RSTART, RLENGTH) }'
It prints out all <k></k>
tags and their content. Now, this would leave you with an output like:
<k>cat</k>
<k>dog</k>
<k>animal</k>
<k>pig</k>
But, that’s not cool. If you want to make the output cooler, just remove the k
tags like so:
cat my-input | sed -e 's/<k>//g' -e 's/<\/k>//g'
To make this even cooler, one can cat
a file and pipe that output to dmenu. That way, you can fuzzy search the word that you’re looking for. So, if you type in: “s”, you’d find something like:
something
abstract
blasphomy
I use this and pipe the selected option to xclip
which puts the word I selected in my clipboard; making it easier for me to write it.