RegEx in Java for suggestions [de]

My Java knowledge is next to zero.
I would like to add some code to the function getAdditionalTopSuggestions() in the file GermanSpellerRule.java 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?

Hi!

This commit should do the job!

1 Like

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

Looks good.