Ignore hashtags, user mentions

LanguageTool now ignores URLs and email addresses (i.e. they are not underlined as spelling mistakes). Would it be useful to do the same with hashtags (#hashtag) and user mentions (@username). What do you think?

This issue was mentioned some time ago here:

1 Like

Yes, also see:

I think having a global disambiguation.xml (that applies to all languages) sounds like a nice solution.

I agree, it sounds nice. So we have: file names, domain names (like languagetool.org), hashtags and user mentions.

I’m wonderig if we will have false negatives in some language. For example, domain names like “aaaa.es” could be an error, although an unusual one (a missing white space plus a missing capitalization). But “es” is a common word in several languages.

I created these rules in Catalan in order to test them: [ca] ignore filenames, hashtags, user mentions... · languagetool-org/languagetool@d9f5070 · GitHub

They seem to work well, without problems.

A global disambiguation.xml file would be easier to maintain (and can be used for other rules, proper nouns, etc.). But it will not allow fine-tuning for each language, so it has to contain only rules fully acceptable to all languages.

I can try to implement the global file in October.

One of the things I see happening a lot, are tags that are incorrect, existing of two parts: #hash tag or #hash-tag (In Dutch, the - is a valid word char, but not a valid tag char for Twitter…

Warming up this old thread.

If I run the sentence “Hallo @sprache, #sprache ist wichtig!” with language “de”, it does not find any issues. But if I use “auto” it complains about “sprache” in each case. Is this intended?

curl -X POST --header ‘Content-Type: application/x-www-form-urlencoded’ --header ‘Accept: application/json’ -d ‘text=Hallo%20%40sprache%2C%20%23sprache%20ist%20wichtig!&language=auto&enabledOnly=false’ ‘https://api.languagetoolplus.com/v2/check

With language=de you don’t get spelling errors. You need language=de-DE (or auto) to get them. That is on purpose.

That means that hashtags and mentions are not ignored in German. (But they are ignored somewhat in the web page languagetool.org, aren’t they? @tiff)

Should we implement the global disambiguation.xml we talked about? @dnaber

Ah thx.

Interesting that it doesn’t alert me that the language “de” doesn’t exist and that I should use “de-DE”. But indeed if I use “de-DE” I get the same feedback as for “auto”.

Awaiting the feedback if this will be handled via the global disambiguation.xml or if I should handle it on my side.

That’s nice! But I wonder if there could be a list of more popular addresses to correct in these cases. So, if I type user@gamil.com it wouldn’t be ignored as there would be an exception for gmail; same for Google, Microsoft, Apple, and so on - and even langaugetool.org, I mean languagetool.org

1 Like

That’s a good idea. Thank you. I have opened an issue: [all languages] find errors in popular emails or web addresses · Issue #5890 · languagetool-org/languagetool · GitHub

1 Like

Semi-related, I guess in hashtags the main thing to ignore is case and replacing spaces with dashes or omitting them entirely. but if I write #safethewales … I would still want it to tell me that it should be #savesthewhales potentially

Do you mean #save_the_whales?

https://www.hashtags.org/featured/what-characters-can-a-hashtag-include/

opps yes :slight_smile:

Maybe, when looking into this, there is also a way to ignore :hug: and the like?

1 Like