add encode(begin iter, end iter)
add getWordLength in encoding.cpp