Back to LanguageTool Homepage - Privacy - Imprint

How to ignore particular xml tag in LT

Dear LT Team,
how to ignore the grammar check or spell check in particular XML tag inside word


Original String = this apple for <skip>yuo</skip>
Results =This apple for <skip>yuo</skip>

Tag inside “yuo” is misspelled but no need to check.
Is there any possibility. Please do the need full.
Thanks in advance.

If you use the HTTP API, you can use the data parameter as documented at!/default/post_check. From Java, you’d need to define the text and markup ranges using AnnotatedTextBuilder.

1 Like


An alternative is to add a rule in disambiguation.xml that ignores text that is inside a tag. Use this as a template:

<rule id="IGNORE_SPELLING_IN_XML_TAGS" name="Ignore spelling in XML tags">
        <token regexp="yes">&lt;</token>
        <token regexp="yes">skip|mytag</token>
        <token regexp="yes">&gt;</token>
            <token regexp="yes">\p{L}+</token><!-- One or more letters in any language -->
        <token regexp="yes">&lt;</token>
        <token><match no="1"/></token>
        <token regexp="yes">&gt;</token>
    <disambig action="ignore_spelling"/>


1 Like

@Mike_Unwalla thanks for your response. i will try and update to you


I forgot…

To ignore the tags such that the grammar checking does not give an error for correct text (ignoring the tags), you can immunize the tags. (I have not done tests to confirm.) Refer to