Enhanced hierarchical bag-of-word library for C++