Is there a way in any LaTeX (LuaLaTex, LuaHBTeX, pdfTeX …) to automatically typeset a document written with standard «s» with long s (ſ) instead where appropriate? The rules seem to be mostly language independent and can be found here.
This is basically the opposite of this question.
I am aware of the OpenType character variant method and produce long s in Latex but those do not answer this question.
MWE
\documentclass{article}
\usepackage[german,english]{babel}
\begin{document}
\section{s}
In German, the s stands (please no automatic replacement)
\begin{description}
\item[At the end of a word]
\foreignlanguage{german}{Das Haus, des Landes}
\item[At the end of a syllable]
\foreignlanguage{german}{dasselbe, Eispalast, Häuschen}
\item[word gap s if the following word is self standing]
\foreignlanguage{german}{Donnerstag, lostreten, deswegen}
\item[a word gap s in case of a following suffix syllable which begins with a consonant]
\foreignlanguage{german}{Häuslein, Wachstum, nachweisbar, Weisheit}
\item[in loan word prefix syllables dis- and des-]
\foreignlanguage{german}{Distribution, Desinfektion}
\item[before d, k, m, n and w]
\foreignlanguage{german}{Dresden, brüsk, Osman, Mesner, Oswald}
\end{description}
\section {ſ}
In German, the ſ stands (in the following example words s should be replaced by ſ )
\begin{description}
\item[at the beginning of a word]
\foreignlanguage{german}{so, sieben}
\item[at the beginning and inside of syllables]
\foreignlanguage{german}{saufen, Wunsch, erstaunen}
\item[at the end of a syllable except composita]
\foreignlanguage{german}{Gasse, Wasser, Bissen, fassen}
\item[before p, t and ch (sch trigraph)]
\foreignlanguage{german}{Knospe, fast, löschen}
\end{description}
\section{ſſ}
The double ſſ stands (double replacement desired):
\begin{description}
\item[if there is as short vowel before the first s and any vowel is following the second s]
\foreignlanguage{german}{Adresse, müssen, Tasse, vergessen}
\item[if a following e is omitted by an apostroph]
\foreignlanguage{german}{ich lass' es sein}
\item[in flexed forms of words that end with -as, -is, -nis and -us]
\foreignlanguage{german}{die Ananasse, Wallisser Aprikosen, des Zeugnisses, des Busses}
\end{description}
\section{ß}
The Esszet ligature ſs ß stands:
\begin{description}
\item[at the end of a word]
\foreignlanguage{german}{muss, nass, Biss}
\item[at the end of a syllable]
\foreignlanguage{german}{hässlich, vergesslich}
\item[before a consonant]
\foreignlanguage{german}{lasst, hasst, wisst, verpasst, verlässlich}
\item[after a long vowel]
\foreignlanguage{german}{grüssen, Strasse, fliessen}
\item[after a diphtong]
\foreignlanguage{german}{heissen, aussen, scheusslich}
\end{description}
joking: It's that easy!
Rules courtesy of \texttt{www.deutsch-kurrentschrift.de}
\end{document}
selnolig
which is affected by this question. Writers in Germany will probably directly enter a Eszet but in Switzerland you would type ss and hope for correct replacement either by ſſ or ß. But selnolig is not doing this today. The MWE for testing is included now.ff
,fi
,fl
,ffi
,ffl
, andtt
ligatures in German-language documents.