Vale Vocabularies in Terminology Checker?

Post here questions and problems related to editing and publishing DITA content.
horisonten
Posts: 30
Joined: Thu Nov 30, 2023 12:45 pm

Vale Vocabularies in Terminology Checker?

Post 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'?
adrian_sorop
Posts: 78
Joined: Wed Jun 22, 2016 2:48 pm

Re: Vale Vocabularies in Terminology Checker?

Post 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.
Adrian Sorop
<oXygen/> XML Editor
http://www.oxygenxml.com
horisonten
Posts: 30
Joined: Thu Nov 30, 2023 12:45 pm

Re: Vale Vocabularies in Terminology Checker?

Post 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
Last edited by horisonten on Mon Jul 01, 2024 1:53 pm, edited 1 time in total.
adrian_sorop
Posts: 78
Joined: Wed Jun 22, 2016 2:48 pm

Re: Vale Vocabularies in Terminology Checker?

Post 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.
Adrian Sorop
<oXygen/> XML Editor
http://www.oxygenxml.com
horisonten
Posts: 30
Joined: Thu Nov 30, 2023 12:45 pm

Re: Vale Vocabularies in Terminology Checker?

Post 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
Post Reply