Back to LanguageTool Homepage - Privacy - Imprint

RegEx in Java for suggestions [de]

(Jan Schreiber) #1

My Java knowledge is next to zero.
I would like to add some code to the function getAdditionalTopSuggestions() in the file that replaces the words in the following list:

  • Emailabruf
  • Emailabrufe
  • Emailabrufen
  • Emailabrufs
  • Emailaccount
  • Emailaccounts
  • Emailadresse
  • Emailadressen
  • ...

with their counterparts in this list:

  • E-Mail-Abruf
  • E-Mail-Abrufe
  • ...
  • E-Mail-Account
  • E-Mail-Adresse
  • ...

That is, I want to add two hyphens, capitalize 'mail' and the word that comes after it, but not blindly, only for the words in the list: I want to keep 'Emailarbeiten' and some other words.

Any ideas?

(Knorr) #2


This commit should do the job!

(Jan Schreiber) #3

Thanks a lot, that was really fast! Let's see if @dnaber agrees.

(Daniel Naber) #4

Looks good.