Day 15
One of the small language learning things I do each year is add a "words of the day" script to my ~/.zshrc for a target language, so that opening a terminal window shows new vocabulary. I typically try to use a frequency list as the word list (so that the most common words pop up in January), and then source the definitions from a few sources.
For 2026, I've obtained A Frequency Dictionary of Spanish [2nd Edition] (2018), Mark Davies and Kathy Hayward Davies; which has both the frequency and the definitions all wrapped up in one source. They also include on disc/online TSV files containing the entire dictionary, which makes scripting my "words of the day" thing incredibly easy. The files are in the UTF-16LE encoding (0xFF 0xFE header), which my terminal didn't like, but converting it to UTF-8 via iconv resolved the issue.
#!/bin/zsh
# to get a prior day's words, call with parameter how many days ago
if [ $# -eq 0 ]; then
offset=0
else
offset=$1
fi
daycount=$((10#`date +%j` - $offset))
# get three words per day
es_words=$(
head -n $((2 + $daycount * 3)) searchable_spanish_utf8.tsv | tail -n 3
)
echo "==="
echo "Here are your Spanish Words of the Day"
echo "(Day $daycount)"
echo "==="
# This line only works as expected under zsh - it prints empty values under bash
echo $es_words | awk -F '\t' '{print $2" ("$3"): "$4"\n Sample Sentence: "$5"\n Translation: "$6}'
echo "==="
Example output if run on January 1st:
===
Here are your Spanish Words of the Day
(Day 1)
===
el,la (art): the (+ m, f)
Sample Sentence: el diccionario tenía también frases útiles
Translation: the dictionary also had useful phrases
de (prep): of, from
Sample Sentence: es el hijo de un amigo mío
Translation: he is the son of a friend of mine
que (conj): that, which
Sample Sentence: dice que no quiere estudiar
Translation: he says that he doesn’t want to study
===
Edit: Don't put it in your ./zshenv, or the shebang line will loop infinitely. Put it in your ~/.zshrc instead. This wasn't an issue for this past year's script because I used a bash shebang line.