rewrite analyzeWord.py in C++11