Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 11-30-2008, 04:18 AM   #1
PieOPah
Addict
PieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-books
 
PieOPah's Avatar
 
Posts: 398
Karma: 914
Join Date: Oct 2008
Location: UK
Device: Sony PRS-505
Spelling Macro

I am currently trying to write a macro to convert US spelling to UK

I have something like this -

Code:
Sub Spelling()
'
' Spelling Macro
' Macro recorded 29/11/2008 by Simon Argent
'
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "color"
        .Replacement.Text = "colour"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

    With Selection.Find
        .Text = "flavor"
        .Replacement.Text = "flavour"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
Is there a more efficient way of doing this - or is there already a macro available I can use?

Many thanks,
PieOPah is offline   Reply With Quote
Old 11-30-2008, 04:34 AM   #2
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
I admire your technical prowess, but I have to question the actual thing you're trying to do.

Books are written in either British or American English - they are distinct "variants" of the language. I just don't see the point of trying to "convert" an American English book to use British English spellings - it will still use American English grammatical constructs, and it will be obvious to the reader that it was written by an American author. What's the point?
HarryT is offline   Reply With Quote
Advert
Old 11-30-2008, 09:54 AM   #3
rhadin
Literacy = Understanding
rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.rhadin ought to be getting tired of karma fortunes by now.
 
rhadin's Avatar
 
Posts: 4,833
Karma: 59674358
Join Date: Dec 2007
Location: The World of Books
Device: Nook, Nook Tablet
Quote:
Originally Posted by PieOPah View Post
I am currently trying to write a macro to convert US spelling to UK
The problem with writing a macro as you are doing is that you have to write a sequence for each word, which will make the macro -- eventually -- so bloated that it will run increasingly slowly, plus it will be difficult to prevent duplication.

I don't know how often you need to do this (or want to do this), but if you have a great need to do this and to do so on a frequent basis, you might want to invest in my set of macros called EditTools. One of the modules included in the macro is called Language Conversion, which is described here. This module will work for converting any language to another language. I use it regularly to convert from non-U.S. spelling to U.S. spelling in the medical books I edit.
rhadin is offline   Reply With Quote
Old 12-01-2008, 05:12 AM   #4
PieOPah
Addict
PieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-books
 
PieOPah's Avatar
 
Posts: 398
Karma: 914
Join Date: Oct 2008
Location: UK
Device: Sony PRS-505
Quote:
Originally Posted by HarryT View Post
What's the point?
I find a lot of the words really annoying.

Color, honor, valor, alunium etc.

Most words don't bother me too much, just some of the more obvious spelling differences - plus if I can sweep through with a macro, it makes the spell check later on so much easier.

I'll stick to the macro I have and add any words as I come across them.

Repeats will be unlikely as once a word has been changed, the spell check won't pick it up meaning I won't add it into the macro again.

I can stop it becoming too bloated by only sticking to specific words and living with the rest.

Thanks,
PieOPah is offline   Reply With Quote
Old 12-01-2008, 12:43 PM   #5
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
One method would be to use a specific British dictionary which would identify American spelling as incorrect. I never heard of alunium in an American spelling.

Dale
DaleDe is offline   Reply With Quote
Advert
Old 12-01-2008, 01:30 PM   #6
PieOPah
Addict
PieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-books
 
PieOPah's Avatar
 
Posts: 398
Karma: 914
Join Date: Oct 2008
Location: UK
Device: Sony PRS-505
Quote:
Originally Posted by DaleDe View Post
One method would be to use a specific British dictionary which would identify American spelling as incorrect. I never heard of alunium in an American spelling.

Dale
Fair enough, probably misspelled anyway,but English is Aluminium...

I wanted the macro to speed things up - for some reason in Word, change all never does...

The macro as is seems to be doing it's job - I rarely have to add any new words now - I just wanted to know if there was a more efficient way of writting the macro. Obviously not...
PieOPah is offline   Reply With Quote
Old 12-01-2008, 01:39 PM   #7
=X=
Wizard
=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.
 
=X='s Avatar
 
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
Quote:
Originally Posted by PieOPah View Post
Is there a more efficient way of doing this - or is there already a macro available I can use?

Many thanks,
Yes there is a much more efficient way of doing this, but it gets more complicated.

A better way would be to do a while loop with a case statment inside
Code:
PSUDO CODE
Match = "color|honor|etc..."

Look for match
While (Match not found)
select (match)
case "color"
replace("color","colour")
case "honor"
replace("honor","honour")
end select
Look for match WEND
This way you only search through the document once and replace each word with the correct selection as you find them.


All the source examples you need are found in the tool BookCreator except for the case statement but a google on "vba select case example" should give you a good example on how to write one.

=X=

Last edited by =X=; 12-01-2008 at 01:41 PM. Reason: close select statment
=X= is offline   Reply With Quote
Old 12-01-2008, 02:08 PM   #8
PieOPah
Addict
PieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-books
 
PieOPah's Avatar
 
Posts: 398
Karma: 914
Join Date: Oct 2008
Location: UK
Device: Sony PRS-505
Many thanks for this =X=

And while I'm at it, thank you for the eBookCreator macros. It was using this that encouraged me to create one for spellings.

I have done a search but for some reason I only get porn results????
http://www.google.co.uk/search?sourc...ase+example%22

Will keep hunting
PieOPah is offline   Reply With Quote
Old 12-10-2008, 08:36 AM   #9
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,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
It just seems silly to me to replace words in this way. If it has color or colour is up to the author. For example, I am reading the Discword series. Terry Pratchett is clearly from the UK. If I went and replaced all colour to color, it would not change the fact. It's obvious fromt he way he writes. I would find it annoying to read UK spellings of some words and then to have cearly American words. Just let the author be American if the author is American.
JSWolf is offline   Reply With Quote
Old 12-10-2008, 08:40 AM   #10
PieOPah
Addict
PieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-books
 
PieOPah's Avatar
 
Posts: 398
Karma: 914
Join Date: Oct 2008
Location: UK
Device: Sony PRS-505
Some spellings don't bother me others really do...

centred (UK)
centreed (US)

That is really annoying...

Aluminum (US)
Aluminium (UK)

again, another one which annoys me!

There are more specifics, but I'm not going to list everything, I am sur eyou get this gist!

And again, with the ability to do so, isn't it MY choice as to whether I read american spelling or UK English?

Last edited by PieOPah; 12-10-2008 at 09:13 AM.
PieOPah is offline   Reply With Quote
Old 12-10-2008, 08:58 AM   #11
Patricia
Reader
Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.
 
Patricia's Avatar
 
Posts: 11,504
Karma: 8720163
Join Date: May 2007
Location: South Wales, UK
Device: Sony PRS-500, PRS-505, Asus EEEpc 4G
Actually, the UK spelling of those words are "centred" and "aluminium".
Patricia is offline   Reply With Quote
Old 12-10-2008, 09:13 AM   #12
PieOPah
Addict
PieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-books
 
PieOPah's Avatar
 
Posts: 398
Karma: 914
Join Date: Oct 2008
Location: UK
Device: Sony PRS-505
Thank you. Typo on centred and got the UK/US wrong way round for Aluminium. I am ill today so will forgive myself those mistakes

Corrected now BTW
PieOPah is offline   Reply With Quote
Old 12-10-2008, 09:14 AM   #13
Patricia
Reader
Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.
 
Patricia's Avatar
 
Posts: 11,504
Karma: 8720163
Join Date: May 2007
Location: South Wales, UK
Device: Sony PRS-500, PRS-505, Asus EEEpc 4G
I hope that you feel better soon, PieOPah.
Patricia is offline   Reply With Quote
Old 12-10-2008, 09:16 AM   #14
PieOPah
Addict
PieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-booksPieOPah has learned how to read e-books
 
PieOPah's Avatar
 
Posts: 398
Karma: 914
Join Date: Oct 2008
Location: UK
Device: Sony PRS-505
Thank you
PieOPah is offline   Reply With Quote
Old 12-10-2008, 10:18 AM   #15
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,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
The American way of spelling centered is centered.

Yes, it is your choice. But the won't the feel of the book maybe be changed? We already had Harry Potter being changed for the US market and I think that was a really bad idea.

What is it about American spelling that bugs you so much?

Last edited by JSWolf; 12-10-2008 at 10:21 AM.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do Americans feel about UK spelling? Luke King Writers' Corner 363 12-03-2010 12:07 PM
Unutterably Silly When Automatic Spelling Correction Goes Wrong RickyMaveety Lounge 11 10-01-2010 09:40 AM
Seriously thoughtful Spelling contractions SameOldStory Lounge 47 09-08-2010 09:08 PM
Word Formatting Macro (Stingo's Macro) Stingo Sony Reader 75 08-24-2010 05:18 AM


All times are GMT -4. The time now is 05:38 PM.


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