Check text voice

In this example, we want to create a rule that verifies if the text voice is active. This means that the text should be written in a way that emphasizes the subject of the sentence and uses active verbs. For example, instead of saying "The ball was thrown by John", we should say "John threw the ball".

Example 6. Rule that verifies if the text voice is active

<sch:rule context="shortdesc">
    <sch:assert test="ai:verify-content('Is active voice used?', .)">
        In the description we should use active voice.</sch:assert>
</sch:rule>


If the text does not follow this rule, we can create a fix that reformulates the text to use active voice. This will improve the clarity and readability of the text.

Example 7. SQF fix that that reformulates the text to use active voice

<sqf:fix id="rephrase">
    <sqf:description>
        <sqf:title>Reformulate the text to use active voice</sqf:title>
    </sqf:description>
    <sqf:replace match="text()" select="ai:transform-content('
		Reformulate to use active voice', .)"/>
</sqf:fix>