Is there a way to exclude spelling variants (en-US/en-GB)?

Here is a rule I created:

<rule id="BE_MADE_AWARE_OF" name="be made aware of">
  <pattern>
    <token inflected="yes">be</token>
    <token>made</token>
    <token>aware</token>
    <token>of</token>
  </pattern>
  <message>Can you shorten this phrase?</message>
  <suggestion>\2 <match no="1" postag="(V.*)" postag_regexp="yes" postag_replace="$1">learn</match> of</suggestion>
  <suggestion>\2 <match no="1" postag="(V.*)" postag_regexp="yes" postag_replace="$1">learn</match> about</suggestion>
  <suggestion>\2 <match no="1" postag="(V.*)" postag_regexp="yes" postag_replace="$1">find</match> out about</suggestion>
  <example correction="also learned of|also learnt of|also learned about|also learnt about|also found out about">Secretary Perry <marker>was also made aware of</marker> efforts to pressure foreign diplomats.</example>
</rule>

In the example, the correction requires that “also learnt of” and “also learnt about” be present. This is fine when writing the examples, but is there a way to exclude en-GB when performing an API call?

I tried using a combination of language=auto and preferredVariants=en-US, but that did not seem to work.

I don’t think so. I think you’d need to split/duplicate the rule in en-US/grammar.xml and en-GB/grammar.xml etc.

1 Like