Can you auto-delete the space before an auto-corrected word?

Hello, my question is whether you can (in Writer) automatically delete the space before an autocorrected word to join that autocorrected word with the word preceding it.

For example (in Polish):
I want to auto-correct while typing: “dal” “bys” to “dałbyś”.

So, I know how to define auto-correct “dal” to “dał”, and “bys” to “byś”. But what I need is also to join these two - in other words remove the space between them while also auto-correcting the latter of the two (as if hitting backspace and then auto-correct the second word).

  • Menu item Tools - Autocorrect - Options …
    • Select the Replace tab
    • In the Replace field, enter dal bys
    • In the With field, enter dałbyś
    • Click the New button, then OK
  • Verify that menu item Tools - Autocorrect - When typing is ticked
    You select the entry to toggle tick/untick

If you also need autocorrection if the words/fragments occur by themselves (not as a pair), you may need to add several entries to the corrections list. I don’t know much Polish, so cannot imagine possible constellations. You can probably find out for yourself. If not, ask again :wink:


A little aside: The thought that strikes me whenever I read about requirement for “advanced autocorrection”:

There is a tiny step from autocorrect to autocorrupt.

+++ (should be pondered upon seventy-seven times !)
This is why I prefer to work without AutoCorrect, even if it looks more painful.

1 Like

Thanks, keme1. However, what you propose applies to only this single combination of words. As “byś” is a rather common suffix in Polish, I’m looking for a more universal way of affixing it to the preceding word - in such a way that after typing “bys” it’s corrected to “byś”, and affixed to the word immediately before it.

Tried inserting as regular expression in a couple of ways, but it looks like the autocorrection does not support the use of regex. I suspect that this requires a rewrite of the autocorrection module, which is out of my league, and also outside the scope of this site.
You can request an enhancement.

Thanks again. I’ll try to request this enhancement, because it would greatly speed up my work - and hopefully also other users’.

Is “byś” always used as a suffix? Or it can be used as a regular word also?

Hi, shantanuo,
yep, it can be used both ways - as a regular word, too.

But actually the list of such 2-tuples in Polish would be massive. Such suffixes as -byś, -bym, -by, -byście, -byśmy are super common — you add them to verbs in the past tense to create conditional verbs.

Then there are suffixes that result in participles: verb + -jąc/-jący/-jącym/-jącego/-jącemu/-jąca/-jącą/-jącej/-jące/-jącym/-jących/-jącymi (all of which are sort of equivalent of -ing)

The list is much, much longer. Then there are prefixes, too.

At the moment I’ve just found a cheap and dirty way around it - I type the verbs and their suffixes separately, and then, after a day’s work I Ctrl+H them:
find: [space]-byś (etc.) / replace: [w/o space]byś

That kind of does the job, but severely obstructs the flow. Also, it takes a lot of time to find/replace all possible suffixes and affixes time and again. As a writer I really need to find a way to define autocorrection for as many verbs as possible, and have a finite list of such suffixes that I could attach as I type.

@maczopikczo @shantanuo posted the question for you on StackExchange, and I had posted an answer there. The solution I posted only works for suffixes. To work for prefixes, I would suggest creating another sub with different SearchString, maybe like this:
args1(11).Value = sinFind & "[ ]+"
https://stackoverflow.com/questions/77965805/a-macro-to-remove-the-first-space

Another macro is available here… 159652 – Finding a way to join a suffix to the word immediately before it, using autocorrect function