Skip to content

This Python script automatically inserts the historical long S character ( ſ ) into text based on language-specific spelling conventions. The long s was commonly used in various European languages from the Medieval to the early Modern period, giving texts an antiquated, old-style appearance.

License

Notifications You must be signed in to change notification settings

travisgk/py-long-s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-long-s

This Python script converts text to use the archaic long S letter ( ſ ) in its spellings.
English, French, German, Spanish, and Italian are supported.

There's also a JavaScript version available which can be used online.

Requirements

pip install unidecode

Example

import long_s

print(long_s.convert("The discussion was surprisingly insightful.", lang="en"))
print(long_s.convert("La discussion était étonnamment perspicace.", lang="fr"))
print(long_s.convert("Die Diskussion war überraschend aufschlussreich.", lang="de"))
print(long_s.convert("La discusión fue sorprendentemente perspicaz.", lang="es"))
print(long_s.convert("La discussione è stata sorprendentemente perspicace.", lang="it"))
The diſcuſſion was ſurpriſingly inſightful.
La diſcuſſion était étonnamment perſpicace.
Die Diskuſſion war überraſchend aufſchluſsreich.
La diſcuſión fue ſorprendentemente perſpicaz.
La diſcuſſione è ſtata ſorprendentemente perſpicace.

Converting a Text File

long_s.convert_text_file(src_path="story.txt", dst_path=None, lang="en"))

Since dst_path is None, the program will save the converted text file as story-long-s.txt.


Special Thanks

Thank you Andrew West of the TeX Users Group for the documentation found under The Rules for Long S, which was fundamental in writing the conversion functions for English, French, Spanish, and Italian.

About

This Python script automatically inserts the historical long S character ( ſ ) into text based on language-specific spelling conventions. The long s was commonly used in various European languages from the Medieval to the early Modern period, giving texts an antiquated, old-style appearance.

Topics

Resources

License

Stars

Watchers

Forks

Languages