self::HEAD_WORDS ) { return $text; } // The opening is the refusal itself ("I can't — not on a call"). // Nothing to replace. if ( preg_match( Text_To_Speech::REFUSAL, $words ) ) { return $text; } // Only replace the opening when a refusal comes after it. // Why: a "sorry" tone alone must not change a normal opening. if ( ! preg_match( Text_To_Speech::REFUSAL, $rest ) ) { return $text; } return $tag . __( 'Sorry', 'aisentic' ) . $gap . $rest; } }