Page 1 of 1

Vale Vocabularies in Terminology Checker?

Posted: Fri Jun 28, 2024 1:47 pm
by horisonten
Hello,
I'm having a hard time making it so that "word2" is not being falsely highlighted if it is in used in combination of an approved word.

word2 on its own should report an error and suggest the correct phrase. It should suggest to use "word1 word2" instead. word1 and word2 in combination is approved and should therefore not throw an error. Currently it is throwing an error because word2 is in the name.

So I need to somehow be able to add custom word combinations that are approved. It seems as if Vocabularies in Vale would solve the issue. But this is not supported currently, correct?

Is there a workaround/hack to make something similar happen using the <incorrect-terms> file or vale 'action' and 'swap'?

Re: Vale Vocabularies in Terminology Checker?

Posted: Mon Jul 01, 2024 8:58 am
by adrian_sorop
Hi,
Unfortunately I don't fully undestand your use case.
Can you please post a real example? A sentence and the expected good/bad words combination that should be matched by Term Checker would be perfect.
Regards,
Adrian S.

Re: Vale Vocabularies in Terminology Checker?

Posted: Mon Jul 01, 2024 1:53 pm
by horisonten
adrian_sorop wrote: Mon Jul 01, 2024 8:58 am Hi,
Unfortunately I don't fully undestand your use case.
Can you please post a real example? A sentence and the expected good/bad words combination that should be matched by Term Checker would be perfect.
Regards,
Adrian S.
Sorry, it was not clear at all when reading it again.
If I write "joint" it should give me a suggestion. But I don't want to it to give me the suggestion if I write "pre-moulded joint" which also includes the word join but as part of an approved suggestion.

See the issue here:
https://drive.google.com/file/d/1Gg_IsT ... p=drivesdk

This doesn't work:
https://drive.google.com/file/d/1Geuqwd ... p=drivesdk

Re: Vale Vocabularies in Terminology Checker?

Posted: Mon Jul 01, 2024 7:27 pm
by adrian_sorop
Hi,
Here's an XML term defintion

Code: Select all

    <incorrect-term ignorecase="true">
        <match type="regular-expression">(?&lt;!pre-moulded\s|taped\s)\bjoint\b</match>
        <message>Do something</message>
        <link>https://www.example.com</link>
    </incorrect-term>
This term, applyed to the following text, it will match only the first 2 paragraphs

Code: Select all

  <p>joint</p>
  <p>some joint</p>
  <p>pre-moulded joint</p>
  <p>taped joint</p>
I changed the type of the match to regular-expression and defined a negative lookbehind to ensure the word "joint" is not preceded by "pre-moulded" or "taped".
The last part is \bjoint\b to match the word "joint" with word boundaries to ensure that it is matched as a whole word and not as a part of another word.
It's up to you if you want to convert the term to Vale rule or use XML rules.

Regards,
Adrian S.

Re: Vale Vocabularies in Terminology Checker?

Posted: Tue Jul 02, 2024 8:23 am
by horisonten
adrian_sorop wrote: Mon Jul 01, 2024 7:27 pm I changed the type of the match to regular-expression and defined a negative lookbehind to ensure the word "joint" is not preceded by "pre-moulded" or "taped".
The last part is \bjoint\b to match the word "joint" with word boundaries to ensure that it is matched as a whole word and not as a part of another word.
It's up to you if you want to convert the term to Vale rule or use XML rules.

Regards,
Adrian S.
Thank you so very much :D
I also got it to work as expected in my .yml file with this;
'(?<!pre-moulded\s|straight\s|taped\s|transition\s)\bjoint\b': pre-moulded joint|straight joint|taped joint|transition joint