Please take a look at lru_cache function inside vst_get_stem(). As of now they are faulty, because varnam does not stem properly with the cache. Once I comment out the cache, everything is fine. I'll resolve this today (17th Aug) but I'm almost clueless. Are there any obvious mistakes I'm making with lru_cache?
I ran "valgrind ./stemmer stemmer_input.txt" on the example and it did not show anything other than 2 "Conditional jump or move depends on uninitialised value(s)". There are other memory leaks. I will fix those too today.