Quote:
Originally Posted by Tex2002ans
I doubt there are many legitimate 4+ single characters by themselves
|
Since there are no italics blackletter fonts, German printers had to use increased letter spacing for emphasis. I.e., there might be even longer words.
@famfam I found a suitable
regex in a German forum and used it to create a simple throwaway plugin that should automatically remove all unwanted spaces.
Please make a backup copy before running this plugin!
Note that if you uncomment the following line in plugin.py by removing the
# sign:
Code:
#unspaced_word = '<span class="italics">{}</span>'.format(unspaced_word)
the plugin will wrap all replaced words in
<span> tags.
And for completeness' sake here are instruction for Calibre Editor:
- Paste (?<=[ ])([\w][ ]+){1,}[\w](?=[ .,:;!?]) in the Find box.
- Select Regex-function from the Mode drop-down box.
- Click Create/Edit, paste the following code in the Code box:
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
spaced_word = match.group(0)
unspaced_word = spaced_word.replace(' ', '')
#unspaced_word = '<span class="italics">{}</span>'.format(unspaced_word)
return unspaced_word
- enter a function name, e.g. Spacer, and click OK.
BTW, you also might want to post your question in the
German MR subforum.