backported fix of sentence detection from yii2 apidoc