Add the tree by vocabulary function.