Hi,
I’m trying to implement a rule as below for a specific use case.
<!-- has the ability|capacity for|to -->
<rule>
<pattern case_sensitive="no">
<token inflected="yes">has</token>
<token>the</token>
<token inflected="yes" regexp="yes">ability|capacity</token>
<token inflected="yes" regexp="yes">for|to</token>
</pattern>
<message>Make sentences concise by eliminating wordy phrases. Use can if possible.</message>
<url>https://writing.wisc.edu/Handbook/CCS_wordyphrases.html</url>
</rule>
Using this rule, I try the sentence, ‘Does he have the ability to commit violence?’, and it does not work.
- Note I am making up this rule, there is an existing rule which handles this specific scenario, I’m trying to understand the logic.
- In the case above, it does not work because, from
dictionary.dump
, have has the inflection has, but has does not have any inflection. - Therefore, to get any such rule to work, the base word has to be replaced with the inflected form of the word in the rule, and it does not work the other way around? Is this correct?
That is, setting <token inflection="yes">has</token>
will not include have
but setting <token inflection="yes">have</token>
will include has
due to the direction of the flow from inflected version -> base version?
Thanks so much,
Tat