![]() |
#1 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Sep 2015
Device: Nexus 7
|
Chapter detection for roman numerals??
Hi, when I convert I would like calibre to detect roman numeral chapters. These chapters don't have the word "chapter" in them, just:
I II III IV etc.. I figured something like: [IVXLCDM]+ but I'm not sure exactly how to write it into the "detect chapter" Xpath expression under the Structural Detection section. Some of the books have the <h2> class tag and some of them have the normal <p> class tag. What would be the exact expression I would use in the xpath line that would detect any combination of "IVXLCDM" as chapters? Thanks! Last edited by g25; 09-07-2015 at 02:17 AM. |
![]() |
![]() |
![]() |
#2 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Better question: What XPath would also manage to avoid the "I" as in, "you and I"?
You need more semantic information. Are there any unique classes or ids used in the <p> chapter tags? |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,912
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() D, did I forget one ![]() I do a lot of my work with the editor, rather than fight a special case Xpath. Beware the Lone I ![]() ([CLXVI]{1,7}) is the basic part of my EDITOR search term The TOC tool (also inside the editor) allows all sorts of solutions for indexing a book. |
|
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Sep 2015
Device: Nexus 7
|
well ([CLXVI]{1,7}) works but unfortunately grabs every other sentence that starts with those letters :/
Anyway to tell it to do ONLY the roman numerals that are on a line by themselves? |
![]() |
![]() |
![]() |
#5 | |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Sep 2015
Device: Nexus 7
|
Quote:
Or reside within ANY tag that has NO other text but a combination of this ([CLXVI]{1,7}) ? Last edited by g25; 09-08-2015 at 09:59 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Sep 2015
Device: Nexus 7
|
Ah got it I think:
//*[re:test(., '[CLXVI]+$')] seems to work! |
![]() |
![]() |
![]() |
#7 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,171
Karma: 8800000
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
Quote:
* Code:
>([CLXVI]{1,7})< bernie |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
regex-function convert roman numerals | weberr | Editor | 11 | 09-22-2021 05:15 PM |
Roman Numerals for series and on book jacket | Arbait | Library Management | 31 | 05-17-2015 01:16 AM |
Disabling roman numerals in series display? | MelBr | Calibre | 2 | 09-19-2013 10:49 PM |
Convert Roman numerals to Arabic? | Peter W | Sigil | 2 | 04-09-2012 11:55 AM |
regex search for roman numerals | Blurr | Calibre | 2 | 12-16-2009 05:55 PM |