Autocorrect specifc words in a TextArea

First: I want to have specific words autocorrect themselves as I am typing. For example I type the following:

My friend is tom. ← I want tom to autocorrect to Tom.

I am on a Linux system and this is for Linux systems only. Is there a way to do this?

Second: I want the first letter of a new sentence to capitalize automatically. For example:

My friend is Tom. we enjoy shooting pool and rifles in our spare time. ← I want the word We to capitalize as it is a new sentence.

Autocorrect is not a trivial problem. You can try with a regex after typing a character. But this might get really slow.

For capitalization, you can set a flag when a period, question mark or quotation mark is typed so the TextArea Keydown event returns an uppercase letter when the flag is set.
You’ll also have to handle changing that flag if you use backspace or delete on sentence ending punctuation.

Hmm, I suppose I can back burner this for a bit while I do some more research and experimentation.

I’ll fiddle with this tonight. Thanks!