update cppcommon/str_functs.cpp for countStrSimilarity