Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

French : replace all apostrophes by a single quotation mark #10963

Open
Bricolas opened this issue Oct 23, 2024 · 9 comments
Open

French : replace all apostrophes by a single quotation mark #10963

Bricolas opened this issue Oct 23, 2024 · 9 comments
Labels

Comments

@Bricolas
Copy link

How can I activate the rule to correct the apostrophe by the right single quotation mark?
In French, the apostrophe is not correct.
https://fr.wikipedia.org/wiki/Apostrophe_(typographie).

@Beurt
Copy link

Beurt commented Nov 16, 2024

I’m also very curious about the answer to this question. Those rules don’t seem to be activated, neither on my local server, nor on LibreOffice Extension:

@danielnaber
Copy link
Member

https://community.languagetool.org/rule/show/APOS_TYP?lang=fr&subId=1
https://community.languagetool.org/rule/show/TYPOGRAPHICAL_APOSTROPHE?lang=en&subId=1

These rules are active only in picky mode. I'm not sure if the LibreOffice add-on has an option to activate that. The browser add-on and API have.

@Beurt
Copy link

Beurt commented Nov 18, 2024

I'm sorry, but I think it is not working with the browser add-on. My browser add-on is set on picky (“Méticuleux” in French) and as you can see, the apostrophe in this very text is not curly, nor detected.

Copie d'écran_20241118_090157
Copie d'écran_20241118_090515

@danielnaber
Copy link
Member

I missed that these have default="off" in their definition. I don't think they can be activated without changing the XML in the LT code, i.e. removing default="off" from these rules.

@Beurt
Copy link

Beurt commented Nov 18, 2024

Thank you for the fast answer. This is very interesting.

I noticed that it was written in those rulesBy default, this rule is not active in LanguageTool”, but, I also noticed the documentation : “By default, all rules are enabled.”.

Apparently, no. All the rules are not enabled by default!

But, that leads me to another question: why?

  • Why adding rules that cannot be enabled by the common user?
  • Why are these rules disabled?

@Beurt
Copy link

Beurt commented Nov 18, 2024

Scanning rules/fr/style.xml I see a lot of interesting rules that are default="off". Why?

e.g.:

        <rulegroup id="ECRITURE_INCLUSIVE" name="écriture inclusive" tone_tags="general">
            <rule>
                <pattern>
                    <token postag="N.*" postag_regexp="yes">
                        <exception regexp="yes">(?-i)[A-Z].*</exception>
                        <exception postag="V.* (ind|con|sub).*" postag_regexp="yes"/></token>
                    <token regexp="yes">ou|et</token>
                    <token><match no="0"/>e
                    <exception regexp="yes">(?-i)[A-Z].*</exception>
                    <exception postag="V.* (ind|con|sub).*" postag_regexp="yes"/></token>
                </pattern>
                <message>Par politesse, le féminin précède le masculin en français.</message>
                <suggestion>\3 \2 \1</suggestion>
                <suggestion><match no="1" postag="(N) ([fm]) ([ps])" postag_regexp="yes" postag_replace="$1 m $3"/>·e</suggestion>
                <example correction="étudiante ou étudiant|étudiant·e">Pour l'<marker>étudiant ou étudiante</marker>.</example>
            </rule>
            <rule default="off">
                <antipattern>
                    <token postag="J . sp?" postag_regexp="yes"/>
                    <token>son</token>
                </antipattern>
                <pattern>
                    <token postag="D m s">
                        <exception regexp="yes">tel|telle|nul|(?-i)CE</exception></token>
                    <token regexp="yes">et|ou</token>
                    <token postag="D f s"/>
                    <token postag="N e s">
                        <exception scope="next" spacebefore="no" regexp="yes">[\[\(]</exception></token>
                </pattern>
                <message>Une autre structure peut sembler plus percutante.</message>
                <suggestion>les \4s</suggestion>
                <example correction="les photographes">Il parle avec <marker>le ou la photographe</marker>.</example>
            </rule>
            <rule>
                <pattern>
                    <token>le</token>
                    <token regexp="yes">et|ou</token>
                    <token postag="D f s"/>
                    <token postag="N [fm] s" postag_regexp="yes">
                        <exception scope="next" spacebefore="no" regexp="yes">[\[\(]</exception></token>
                </pattern>
                <message>Une autre structure peut sembler plus percutante.</message>
                <suggestion>la personne \4</suggestion>
                <suggestion>\1 <match no="4" postag="(N) ([fm]) (s)" postag_regexp="yes" postag_replace="$1 ([em]) $3"/>·e</suggestion>
                <example correction="la personne professeur|le professeur·e">Il parle avec <marker>le ou la professeur</marker>.</example>
            </rule>
            <rule>
                <pattern>
                    <token>un
                        <exception scope="previous">l'</exception></token>
                    <token regexp="yes">et|ou</token>
                    <token postag="D f s"/>
                    <token postag="N [fm] s" postag_regexp="yes">
                        <exception scope="next" spacebefore="no" regexp="yes">[\[\(]</exception></token>
                </pattern>
                <message>Une autre structure peut sembler plus percutante.</message>
                <suggestion>la personne \4</suggestion>
                <suggestion>un·e <match no="4" postag="(N) ([fm]) (s)" postag_regexp="yes" postag_replace="$1 ([em]) $3"/>·e</suggestion>
                <example correction="la personne professeur|un·e professeur·e">Il parle avec <marker>un ou une professeur</marker>.</example>
            </rule>
        </rulegroup>

or

        <rule id="MAIS_SENT_START_2" name="'Mais' en début de phrase" tone_tags="formal" default="off">
            <antipattern>
                <token postag="SENT_START"/>
                <token skip="3">mais</token>
                <token postag="SENT_END"/>
            </antipattern>
            <antipattern>
                <token postag="SENT_START"/>
                <token>mais</token>
                <token postag="A"><exception regexp="yes">beaucoup|contrairement|déjà|devant|derrière</exception></token>
                <token postag="[DPZR].*" postag_regexp="yes"/>
            </antipattern>
            <antipattern>
                <token postag="SENT_START"/>
                <token>mais</token>
                <token>bon</token>
                <token postag="[DPZR].*" postag_regexp="yes"/>
            </antipattern>
            <pattern>
                <token postag="SENT_START"/>
                <marker>
                    <token case_sensitive="yes">Mais</token>
                    <token><exception negate="yes" regexp="yes">\p{L}[\p{L}'-]*</exception></token>
                </marker>
            </pattern>
            <message>L'utilisation de "Mais" en première position dans une phrase n'est pas incorrecte, mais plutôt un parti pris stylistique. Vous pouvez l'accompagner d'une virgule pour marquer une pause.</message>
            <suggestion>\3</suggestion>
            <suggestion>\2, \3</suggestion>
            <url>https://www.academie-francaise.fr/car-en-debut-de-phrase#:~:text=Les%20conjonctions%20de%20coordination%20ne,pas%20de%20m%C3%AAme%20pour%20car.</url>
            <example correction="Il|Mais, il"><marker>Mais il</marker> lui était impossible de revenir en arrière.</example>
            <example correction="Çağan|Mais, Çağan"><marker>Mais Çağan</marker> était carrément vert.</example>
            <example>Il me semble que cet homme est inconscient, mais il n'a pas l'air d'être blessé.</example>
            <example>Mais peu importe.</example>
            <example>Mais bon Sophie est rentré à nouveau chez elle.</example>
        </rule>

There is also a lot in grammar.xml.

@Beurt
Copy link

Beurt commented Nov 18, 2024

In a very old documentation (https://web.archive.org/web/20120102085443/http://www.languagetool.org/development/) I found this:

  1. Turning the rule off

Some rules can be optional, useful only in specific registers, or very sensitive. You can turn them off by default by using an attribute default="off". The user can turn the rule in the Options dialog box, and this setting is being saved in the configuration file.

It does not seem to be accurate anymore.

And I still don't understand why there is the default="off" attribute (I understand the `default="temp_off" attribute!).

@LucieSteib
Copy link
Collaborator

Hi :)
The apostrophe rule was deactivated as, it was pointed before, apostrophes are extremely frequent in French.
The rule for apostrophes is off for two main reasons:

  • We don't have yet a way to "turn all apostrophes" to the correct typographical one. It was extremely annoying to click on every apostrophe to correct.
  • The error counter was displaying hundreds of errors that were all apostrophes.
    About the defaut="off", it's to avoid seeing the rule in the nightly regression test, that doesn't change much outside of this.
    Hope this helps!

@Beurt
Copy link

Beurt commented Nov 18, 2024

Thanks for the answer!

Too bad there is no GUI to switch these interesting rules (that are existing) back on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants