In your own app modifying the word completions from NNTextView is as simple as implementing textView:completions:forPartialWordRange:indexOfSelectedItem:
Is there any way to do tjis for other apps, that is replacing or augmenting the built-in word completion suggestions?
Yes, to some extent. You need to write a spell server. Once installed, you can select the default spell checker in the system preferences. For documentation, see Apple’s introduction and detailed references, e.g. for
NSSpellServer.However, I don’t think you can implement everything in your own spell server what Apple’s standard spell/grammar checker does; compare the list of methods
NSSpellServerneeds to implement, and methodsNSSpellCheckerhas. Apple slowly adds toNSSpellServerthe methods which correspond to those ofNSSpellChecker… let’s hope Apple does this quickly.