In Polish typography, one should avoid putting prepositions at the end of the line.
Example:
Nie wiedziałem, że nie umieszcza się przyimków na - bad
końcu strony.
Nie wiedziałem, że nie umieszcza się przyimków - good
na końcu strony.
Can I force LaTeX to put ~ after every word that is a preposition (e.g. w, z, na, o etc...) so I don't need to put them manually?

w~and you'll be OK. – egreg Mar 6 '12 at 10:24xesearchpackage might be up to the task (the user manual is worth seeing, with some nice effects). – Bruno Le Floch Mar 6 '12 at 10:46