09-04-2017, 01:17 AM | #541 |
Wizard
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
|
apologies if this is somewhere within the 539 previous posts...
I want to fix a few book errors where the is no space between a closing period and the 1st character of the next sentence. But I don't know how to do " not" in regex & the obvious search would be a "." followed by [ not a space - regular or nbsp ] because a sentence can start with a letter or with an opening quote mark, and those come in various flavors or is there a better way ? |
09-04-2017, 02:06 AM | #542 |
Interested in the matter
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
|
Search:
\.[^\s] |
02-11-2018, 10:29 PM | #543 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
I'd like to search all files for some unwanted characters (some of them are special). It's these ones: Quote:
|
|
02-12-2018, 01:31 AM | #544 |
Unicycle Daredevil
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
|
Have you tried putting a backslash before each of them in your search term? Like:
Code:
([\•\^\*\|\_\[]) EDIT: Just quickly tested the search. It works. Last edited by doubleshuffle; 02-12-2018 at 01:33 AM. |
02-12-2018, 03:12 AM | #545 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
My mistake was trying to insert a | between each character. |
|
02-18-2018, 05:56 AM | #546 |
Unicycle Daredevil
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
|
Question: Finding all Greek words
I'm working on a huge book which has lots of words in Greek. I want to put a span around each of them (or, if it's a string of words, around the whole string, ideally). Does anyone have an idea how to accomplish this with a regex?
|
02-18-2018, 06:27 AM | #547 |
Connoisseur
Posts: 57
Karma: 600000
Join Date: Jan 2018
Device: Galaxy Tab S2
|
Search
(\p{Greek}{1,}) Replace <span class="greek">\1</span> with unchecked minimal match Consecutive words can be bound together by Find </span> <span class="greek"> replace by one single blank |
02-18-2018, 06:31 AM | #548 |
Unicycle Daredevil
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
|
Wow, thanks! I had no idea you could just specify Greek as a character class!
|
02-18-2018, 11:54 AM | #549 |
A Hairy Wizard
Posts: 3,094
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
I'm pretty sure that is checking for Greek 'letters' not words. As long as you are using the Greek alphabet and not a romanization/translation it should work fine.
Code:
\p{ name } Matches any single character in the Unicode general category or named block specified by name. ex: \p{Lu} "C", "L" in "City Lights" \p{IsCyrillic} "Д", "Ж" in "ДЖem" \p{IsGreekandCoptic} edit: Here is a link to a unicode regex reference list for anyone else looking. Last edited by Turtle91; 02-18-2018 at 12:04 PM. |
02-18-2018, 12:01 PM | #550 |
Unicycle Daredevil
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
|
Well, Greek words written in Greek letters. That's what I was trying to find, and the regex worked perfectly for that. (Srsly, do you really think I would have asked for a regex to find Greek words written in the Latin alphabet???)
|
02-18-2018, 12:45 PM | #551 |
A Hairy Wizard
Posts: 3,094
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Just wanted to clarify for others out there....
My wife is a Latin teacher with several years of Greek in school... She had several issues with romanized "Greek" words put out there by people trying to be 'helpful'. |
02-18-2018, 02:19 PM | #552 |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
One minor tweak. I would recommend replacing with:
Code:
<span class="greek" lang="grc" xml:lang="grc">\1</span> grc: Ancient Greek (to 1453) el: Modern Greek (1453-) You could see the list of lang codes here: https://www.iana.org/assignments/lan...ubtag-registry Side Note: Marking your HTML up with proper lang is helpful (Dictionary lookup, Spellchecking, Hyphenation, Search, [...]). |
02-18-2018, 04:10 PM | #553 |
Unicycle Daredevil
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
|
Thanks, I wasn't aware of that. Does the language info have to be in the html tags, or can I also put it in the stylesheet?
|
02-18-2018, 06:04 PM | #554 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
The code has the potential to look really ugly, so I would use it sparingly. Text-to-Speech For example, this would help text-to-speech read the words using the proper accents: Code:
<p>I like to eat tacos.</p> <p class="spanish" lang="es" xml:lang="es">Me gusta comer tacos.</p> <p>Go with me to the store.</p> "me" in Spanish is spoken like "may", while English is spoken like "mee". Or you can mark a small group of words. For example, some styles make foreign words italic: Code:
<p>The con artist ordered <i lang="es" xml:lang="es">pollo con carne</i> from the Mexican restaurant.</p> Also, Calibre supports Multi-Language Spellcheck, so when you use the Spellcheck word list you can see the differences: So you can see that: con (Spanish) =/= con (English) |
|
12-11-2018, 02:43 PM | #555 |
Wizard
Posts: 1,023
Karma: 10963125
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
I'm at a book where quotations are marked by right- (opening) and left-pointing double angle quotes (» and «).
First problem: Frequently, in the middle of direct speech marked as reported, there are citations that are as well marked by right- and left-pointing double angle quotes. I would like to replace those citations by single angle quotes. Is there a good way to find them (only in the middle of direct speech, not outside)? Second problem: It appears, that at direct speech passages, there is an opening double angle, but the closing one is missing (by error of OCR, perhaps). How can I find (and replace) such items, please? Edit: Sometimes it's vice-versa: the closing mark is there, but the opening one is missing. Any help appreciated! Last edited by Leonatus; 12-11-2018 at 02:49 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Examples of Subgroups | emonti8384 | Lounge | 32 | 02-26-2011 06:00 PM |
Accessories Pen examples | Gunnerp245 | enTourage Archive | 15 | 02-21-2011 03:23 PM |
Stylesheet examples? | Skitzman69 | Sigil | 15 | 09-24-2010 08:24 PM |
Examples | kafkaesque1978 | iRiver Story | 1 | 07-26-2010 03:49 PM |
Looking for examples of typos in eBooks | Tonycole | General Discussions | 1 | 05-05-2010 04:23 AM |