C version of libtfidf