The ROUGE-W algorithm to calculate the similarity of texts is referred in more than 500 scientific publications since 2004. The power of the algorithm depends on the weight function choice. An optimal selection of the weight function is studied. The weight functions used previously are far from optimality. An example of incorrect output of the algorithm is provided. Simple changes are described to ensure the expected result.