It's science. Scientific paper about word stemming in the german language. After looking at available software, they developed their own stemmer, on Github. Looks like it supports different programming languages, including perl.
BTW, i know nothing about language analysis. So i asked Uncle Google and Aunt Bing.
Edit: I'm pretty sure if you include the huge vocabulary of curse words he must have known (due to him being a german and loosing two world wars), i'm pretty sure there are a lot more than 500 words he knew.
perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'