I recently created the AbstractSpecificCaseRule. But as @dnabersaid the txt file should not be loaded every time the rule constructor is called.
And here is the problem, I guess the solution to this would be to make loadPhrases() method static. But it uses the path that is defined in the subclasses (the SpecificCaseRule of each language), so I cannot call the abstract getPhrasesPath() method from the static loadPhrases() .
SpecificCaseRule detects phrases that must be written with a specific capitalization. Here you can find the txt file that contains the english specific case expressions, so you can see some examples.
Thank you @dnaber, I looked at it but it was more difficult than I expected unfortunately. I will work more on it on Tuesday, when I will have more time, and I hope I’ll get it done.
Thanks for the help @dnaber! Initially, I thought that using CachingWordListLoader I could somehow load the phrases only one time, but this wasn’t the case in the end.