Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 10-19-2016, 11:57 AM   #1
sjhawar
Member
sjhawar began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Oct 2016
Device: none
Unable to use spellcheck dictionary for italicizing words

In Sigil, Preferences>Spellcheck Dictionaries, I have added a dictionary called "Sanskrit" by selecting "Add" and pasting the words from a .txt file. Since these words exist in the .xhtml files, now I would like to italicize them. How to do it? Could the said dictionary file be used to Find and Replace to italicize the words? If the said dictionary can somehow be displayed (currently, there exists "Add to Dictionary" but not Display Dictionary), a user can click on any displayed word to reach its location on the .xhtml file to italicize it.
sjhawar is offline   Reply With Quote
Old 10-19-2016, 12:32 PM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
The short answer is, you can't. Not with a spellcheck dictionary anyway. Spellcheck Replace doesn't differentiate between font-variants. And it's not intended to alter the formatting of the found word. Replacing misspelled words with Spellcheck deals with spelling only. Formatting doesn't enter into it.

You'll have to italicize them manually, or with a standard find and replace action (regex or otherwise).

Last edited by DiapDealer; 10-19-2016 at 12:36 PM.
DiapDealer is online now   Reply With Quote
Advert
Old 10-19-2016, 01:20 PM   #3
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
@sjhawar:

As DiapDealer has already suggested, you might be able to use the built-in Regex search feature to wrap all Sanskrit words in italics tags.

Depending on the number of Sanskrit words in your custom dictionary, you might be able to use a single Regex expression to do this.

Locate your user dictionary using the following instructions and attach it to your post:

1. Select Edit > Preferences > Open Preferences Location.
2. Double-click user_dictionaries.

(If it's a rather large user dictionary, indicate the total number of lines and post the first 15 lines.)

Last edited by Doitsu; 10-19-2016 at 01:24 PM.
Doitsu is offline   Reply With Quote
Old 10-19-2016, 01:36 PM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
A plugin could also be written that could access a user dictionary and attempt to italicize the words it contains. But it would prove problematic determining whether or not a particular word was already italicized or not.
DiapDealer is online now   Reply With Quote
Old 10-19-2016, 01:53 PM   #5
varlog
actually it is /var/log
varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.
 
varlog's Avatar
 
Posts: 341
Karma: 2994236
Join Date: Sep 2012
Location: usually Europa
Device: prs t1
For a few words you can use Tools->Spellcheck. Clicking on the word in "Word" column will bring you to this word in "Code View" window. The rest, alas, has to be done manually.
varlog is offline   Reply With Quote
Advert
Old 10-19-2016, 02:49 PM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,981
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
One way to do this is to spellcheck in English and when you come upon the Sanskrit as misspelled, then you can manually make sure it's italicized.
JSWolf is offline   Reply With Quote
Old 10-20-2016, 12:34 AM   #7
sjhawar
Member
sjhawar began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Oct 2016
Device: none
>For a few words you can use Tools->Spellcheck. Clicking on the word in "Word" column >will bring you to this word in "Code View" window.
The above is a good idea to manually italicize if somehow all the words from my dictionary called "Sanskrit" are displayed in "Code View" window.
sjhawar is offline   Reply With Quote
Old 10-20-2016, 12:46 AM   #8
sjhawar
Member
sjhawar began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Oct 2016
Device: none
Quote:
Originally Posted by Doitsu View Post
@sjhawar:

As DiapDealer has already suggested, you might be able to use the built-in Regex search feature to wrap all Sanskrit words in italics tags.

Depending on the number of Sanskrit words in your custom dictionary, you might be able to use a single Regex expression to do this.

Locate your user dictionary using the following instructions and attach it to your post:

1. Select Edit > Preferences > Open Preferences Location.
2. Double-click user_dictionaries.

(If it's a rather large user dictionary, indicate the total number of lines and post the first 15 lines.)
Please download the "Sanskrit" dictionary from the following link:
http://www.mediafire.com/file/jvh45l...it268words.txt
sjhawar is offline   Reply With Quote
Old 10-20-2016, 12:54 AM   #9
sjhawar
Member
sjhawar began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Oct 2016
Device: none
Quote:
Originally Posted by DiapDealer View Post
A plugin could also be written that could access a user dictionary and attempt to italicize the words it contains. But it would prove problematic determining whether or not a particular word was already italicized or not.
A Plugin is a good idea to help many users. If a particular word was already italicized, no need to italicize again. Is the following helpful to you?
http://www.codeproject.com/Tips/1003...n-a-Word-Docum
Using the Code
Create a new macro in Word and paste in the following code (tested in version 2010). When you run the macro, all words in your document that are not Dutch, but are US/UK English, are formatted in italics, unless they were already italic, in which case they are formatted normally (assuming that surrounding words are in italics, so we highlight the word in question by making it normally formatted).


Sub ItalicizeEnglish()

If Application.Documents.Count < 1 Then
MsgBox "No documents are open!"
Return
End If

ActiveDocument.Content.LanguageID = msoLanguageIDDutch
ActiveDocument.Content.NoProofing = False

For Each w In ActiveDocument.SpellingErrors
If Not ItalicizeIfInLanguage(w, msoLanguageIDEnglishUS) Then
b = ItalicizeIfInLanguage(w, msoLanguageIDEnglishUK)
End If
Next

End Sub

Function ItalicizeIfInLanguage(w, lan) As Boolean
oldlan = w.LanguageID
w.LanguageDetected = False
w.LanguageID = lan
If w.SpellingErrors.Count = 0 Then
w.Font.Italic = Not w.Font.Italic
ItalicizeIfInLanguage = True
Else
w.LanguageID = oldlan
ItalicizeIfInLanguage = False
End If
End Function
sjhawar is offline   Reply With Quote
Old 10-20-2016, 01:36 AM   #10
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@sjhawar - Since you've mentioned Word, the e-Book Tools Word add-in has a feature that will Mark (highlight colour) all occurrences of words in a designated list.

Once marked you can use Word's Search and Replace to italicise the highlighted words, and then remove the highlights. The Add-in has a raft of other features - including ePub Import and Export, and my favourite - Dialogue Checking

BR
BetterRed is offline   Reply With Quote
Old 10-20-2016, 02:28 AM   #11
sjhawar
Member
sjhawar began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Oct 2016
Device: none
Quote:
Originally Posted by BetterRed View Post
@sjhawar - Since you've mentioned Word, the e-Book Tools Word add-in has a feature that will Mark (highlight colour) all occurrences of words in a designated list.

Once marked you can use Word's Search and Replace to italicise the highlighted words, and then remove the highlights. The Add-in has a raft of other features - including ePub Import and Export, and my favourite - Dialogue Checking

BR
Interesting to know about the Word plugin. However, I am using sigil (also Calibre) to edit my epub file. Any such plugin for Sigil or Calibre?
sjhawar is offline   Reply With Quote
Old 10-20-2016, 04:30 AM   #12
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by sjhawar View Post
A Plugin is a good idea to help many users. If a particular word was already italicized, no need to italicize again. Is the following helpful to you?
I doubt that there are many user that would be interested in this. Even so, the code you copied would not help, it is aimed at Word and that works completely different.

That being said, depending on the source, the Sanskrit could already be identified in the text as being another language as the source with the lang attribute. If so, one S&R could suffice.

Quote:
Originally Posted by sjhawar View Post
Interesting to know about the Word plugin. However, I am using sigil (also Calibre) to edit my epub file. Any such plugin for Sigil or Calibre?
No, there isn't. The add-in is also not intended for ePUB editing. It is mainly intended for correcting the source before creating an ePUB. If your source is in a Word document already, the method BR describes would work fine. You could also, but that would probably be more work, create a S&R ruleset with the Words in your dictionary.

You could opt to import your ePUB into Word, run the Mark tool and then export again to ePUB. You are the only one that could determine if it would be worth the time.
Toxaris is offline   Reply With Quote
Old 10-20-2016, 04:42 AM   #13
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by sjhawar View Post
Interesting to know about the Word plugin. However, I am using sigil (also Calibre) to edit my epub file. Any such plugin for Sigil or Calibre?
Maybe you could adapt this sigil plugin, Plugin for tidying ePub files

BR
BetterRed is offline   Reply With Quote
Old 10-20-2016, 06:15 AM   #14
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
@sjhawar:

IMHO, the easiest solution would be to import a Saved Search group. The Saved Search .ini format is pretty straightforward and can be easily generated from a list with a spreadsheet program or a script.

A typical Save Search file looks like this:

Code:
[search_entries]
1\Name=Group Name/Search Name
1\Find=Find1 
1\Replace=Replace1
2\Name=Group Name/Search Name
2\Find=Find2 
2\Replace=Replace2
size=2
I converted your sanskrit list to a simple Saved Search file and attached it to this post. Note that since this Saved Search contains regular expressions, you'll need to enable the Regex mode in the Find and Replace window.

To import and use a Saved Search:

1. Press CTRL+F to display the Find and Replace window and select Regex, if isn't already selected.
2. Unzip sanskrit.ini from sanskrit.ini.zip.
3. Select Tool > Saved Searches.
4. Right-click in the Saved Searches window, select Import and import sanskrit.ini. This should create an Imported group, if it doesn't already exist. (The group might also be added as a subgroup to the first selected Saved Search group.)
5. Click Imported, highlight Sanskrit and click Load Search.
6. In the Saved Searches window, click Find followed by Replace or Replace/Find.

If you didn't use italics elsewhere in the book you could also click Replace All and then double-check all italics tags.

It goes without saying, that you should make a backup of your book, before testing this potentially very dangerous method!!!
Attached Files
File Type: zip sanskrit.ini.zip (3.2 KB, 202 views)

Last edited by Doitsu; 10-20-2016 at 06:18 AM.
Doitsu is offline   Reply With Quote
Old 10-20-2016, 09:02 AM   #15
sjhawar
Member
sjhawar began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Oct 2016
Device: none
>You could opt to import your ePUB into Word, run the Mark tool and then export again to ePUB.

I already did that but what happens is that all my endnotes become unclickable when I convert from epub to doc.
sjhawar is offline   Reply With Quote
Reply

Tags
dictionary, find and replace, italicize, spellcheck


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use a spellcheck dictionary for italicizing sjhawar Introduce Yourself 3 10-19-2016 05:56 PM
Unable to select words in a PDF brennus Kobo Reader 2 09-17-2015 03:17 PM
Add Spellcheck Dictionary Leonatus Editor 6 02-12-2015 12:16 PM
SPELLCHECK NATION: Does SpellCheck have a dark side? cbaehr Self-Promotions by Authors and Publishers 10 11-07-2010 12:45 PM
PDF to MOBI conversion - unable to detect any words qwerty123456 Calibre 1 07-22-2010 07:54 AM


All times are GMT -4. The time now is 03:02 PM.


MobileRead.com is a privately owned, operated and funded community.