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

Remove the necessity for the fine space or "espace insécable" before question and exclamation marks in Canadian French #11165

Closed
seblavoie opened this issue Jan 6, 2025 · 3 comments
Labels

Comments

@seblavoie
Copy link

The Canadian French language keeps giving errors saying exclamation and question marks should be preceded by a fine space. This is correct in France, but this space, while also accepted and optional, is very uncommon and mostly ommited in Canadian French.

The official documentation of the Office Québécois de la langue française says :

L’Office québécois de la langue française opte pour l’absence d’espace devant le point-virgule, le point d’exclamation et le point d’interrogation. Cette dernière pratique, qui est répandue dans l’usage, tend à devenir une convention, notamment en raison des limites de certains logiciels qui ne comportent pas l’espace fine (espace insécable réduite). Cela dit, si l’on dispose de l’espace fine, son emploi demeure convenable.

which translates to:

The Office québécois de la langue française opts for the absence of spaces before semicolons, exclamation marks and question marks. This latter practice, which is widespread in usage, is tending to become a convention, not least because of the limitations of certain software programs that don't include the fine space (reduced non-breaking space). That said, if the fine space is available, its use remains appropriate.

Screenshot 2025-01-06 at 17 35 18

I'd gladly send a pull request, but can't figure where the conditions for the various languages are in the relevant file, which I think is this one: https://github.com/languagetool-org/languagetool/blob/master/languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/QuestionWhitespaceRule.java

Let me know if you need any help, thanks!

@danielnaber
Copy link
Member

@seblavoie
Copy link
Author

seblavoie commented Jan 8, 2025

Thank for the suggestion. I'm unfortunately having some issues running the code locally and Java is not a language I'm familiar with. So the pull request might have to be made by someone else after all.

@danielnaber
Copy link
Member

I think you could add the rules' id (FRENCH_WHITESPACE) to https://github.com/languagetool-org/languagetool/blob/master/languagetool-language-modules/fr/src/main/java/org/languagetool/language/CanadianFrench.java#L50

That actually doesn't seem to be enough. Adding this to JLanguageTool.getAllBuiltinRules() seems to help:

      if (!language.getDefaultDisabledRulesForVariant().isEmpty()) {
        rules = rules.stream().filter(k -> !language.getDefaultDisabledRulesForVariant().contains(k.getId())).collect(Collectors.toList());
      }

Let me talk to my colleagues to see if we can make this change.

danielnaber added a commit that referenced this issue Jan 9, 2025
…ultDisabledRulesForVariant() is now also used for Java rules (#11165)
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

2 participants