construct word graph
test data