C++ code to diagram sentences