PRAEP_GEN works incorrectly

I am self hosting Language Tool for my application. I am using the German version, which includes the german rule “PRAEP_GEN”, that marks a sentence that starts with words like “wegen” and aren’t followed with Genitiv as incorrectly. I have modified the rule to include sentences that start with “während” instead of "wegen, which works fine for some sentences, but not for all. For example “während dem Tag” is marked as incorrectly, while “während dem Eintauchen” is marked as correct, even though it is wrong. What could be the reason vor that?
I feel like it might not understand that “Eintauchen” is no Genitiv, but it doesn’t mark the word itself as incorrect, so it must be somewhere in the dictionary.

You can use Textanalyse - LanguageTool to see the internal analysis of LT. Maybe we can help if you post the full XML of your rule.

Sure, here you go:

                <antipattern><!-- compound error "wegen des iPhone Angebots" -->
                    <token regexp="yes">de[nm]|ihre[nm]|[dms]?eine[nm]|unse?re[nm]|diese[nm]|jene[nm]|eure[nm]</token>
                    <token postag="(ADJ|PA[12]):DAT:SIN:(NEU|MAS):GRU:IND.*" postag_regexp="yes" min="0" />
                    <token postag="SUB:(DAT|NOM|AKK):SIN:(MAS|FEM|NEU)" postag_regexp="yes" />
                    <token postag="SUB:DAT:SIN:(MAS|FEM|NEU)" postag_regexp="yes" />
                    <token postag="SENT_START|VER:.*|KON.*" postag_regexp="yes" />
                        <token regexp="yes">Wegen|Während|(Ab|Zu)züglich|Angesichts|Abseits|Anhand|Aufgrund|Infolge|Innerhalb|Außerhalb|Ausserhalb|Jenseits|Kraft|Mithilfe|Namens|Seitens|Unfern|Zwecks|Hinsichtlich</token>
                        <token regexp="yes">de[nm]|[Ii]hre[nm]|[Ddms]?eine[nm]|unse?re[nm]|diese[nm]|jene[nm]|[Ee]ure[nm]</token>
                        <token postag="(ADJ|PA[12]):DAT:SIN:(NEU|MAS):GRU:IND.*" postag_regexp="yes" min="0" />
                        <token postag="SUB:(DAT|NOM|AKK):SIN:(MAS|FEM|NEU)" postag_regexp="yes" />
                <message>Die Präposition '<match no="2" case_conversion="startlower"/>' erfordert standardsprachlich den Genitiv.</message>
                <suggestion suppress_misspelled="yes">\2 <match no="3" regexp_match="(?i)e[mn]$" regexp_replace="es" /> \4 <match no="5" postag="SUB:GEN:SIN:.+" postag_regexp="yes" /></suggestion>
                <example correction="Wegen des Unfalles|Wegen des Unfalls"><marker>Wegen dem Unfall</marker> kam ich zu spät.</example>
                <example correction="Wegen Ihres langsamen Autos"><marker>Wegen Ihrem langsamen Auto</marker> konnten Sie nicht kommen.</example>
                <example correction="wegen eines Unfalles|wegen eines Unfalls">Ich bin <marker>wegen einem Unfall</marker> zu spät gekommen.</example>
                <example correction="wegen des Geldes|wegen des Gelds">Tom kam <marker>wegen dem Geld</marker> hierher. </example>
                <example correction="Wegen des schlechten Wetters"><marker>Wegen dem schlechten Wetter</marker> hatte das Flugzeug drei Stunden Verspätung.</example>
                <example correction="Wegen unseres Termines|Wegen unseres Termins"><marker>Wegen unseren Termin</marker> muss ich später leider absagen.</example>
                <example correction="wegen des schönen Filmes|wegen des schönen Films">Die Frau hat <marker>wegen dem schönen Film</marker> geweint.</example>
                <example correction="wegen eines kranken Diktators">Alles nur <marker>wegen einem kranken Diktator</marker>.</example>
                <example><marker>Wegen des</marker> Unfalls</example>
                <example><marker>Wegen ihres</marker> Unfalls</example>
                <example>Ich bin <marker>wegen eines</marker> Unfalls zu spät gekommen.</example>

The analysor correctly marks dem Eintauchen as Dativ, so I feel I might’ve made an error in the XML or didn’t understand it correctly

Okay, I got it to work for “Eintauchen”, the trick was to change <token postag="SUB:(DAT|NOM|AKK):SIN:(MAS|FEM|NEU)" postag_regexp="yes" /> to <token postag="SUB:(DAT|NOM|AKK):SIN:(MAS|FEM|NEU)(:INF)?" postag_regexp="yes" />, since Eintauchen is of type INF. Thank you a lot, you analysor was super helpful. Now I just have a problem, I am also using the word “Ausstoß”, which doesn’t get any tag in the analysor. Why is that and how can I fix it?

You can add missing words to the added.txt file in LT.

Thank you, that fixed it.