Mobile menu

Macro for correcting specific frequent spelling mistakes
Thread poster: ahmadwadan.com

ahmadwadan.com  Identity Verified
Kuwait
Local time: 04:23
English to Arabic
+ ...
Jun 26, 2008

Hi,

I need a Macro for correcting specific frequent spelling mistakes which I already know and have a list of.

Lets say that you frequently receive files of almost the same spelling mistakes such as:

adn>>and
financail>>financial
to gether>>together …etc

What I need is a macro to automatically fix such mistakes in source before starting translation so matching percentage of Trados gets high.

Note: the macro is supposed to have a control to convert “whole words” so it will not make a mess of correct words. For example: it is not supposed to convert “adn” to "and" when it occurs in “adnan”

Thank you so much
I appreciate your help

Ahmad Wadan
Financial Translator


Direct link Reply with quote
 

Wolfgang Jörissen  Identity Verified
Belize
Member
Dutch to German
+ ...
Easy task for the macro recorder in Word Jun 26, 2008

... which produced this:

Sub SpellReplace()
'
' SpellReplace Makro
' Makro zapisane 6/26/2008 przez Wolfgang Jörissen
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "adn"
.Replacement.Text = "and"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.CorrectHangulEndings = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "financail"
.Replacement.Text = "financial"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.CorrectHangulEndings = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "to gether"
.Replacement.Text = "together"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.CorrectHangulEndings = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub


Direct link Reply with quote
 

Tony M  Identity Verified
France
Local time: 03:23
Member
French to English
+ ...
I have a beta version of a little program that does this Jun 26, 2008

The only snag is, since it is still only in development, the list of words and corrections has to be entered manually, which is fiddly and tedious if the list is very long.

If no other solution comes to light, this might be of some interest.

(NB: it doesn't cope very well with the 'whole words only' issue, but there is a sort of fudge that helps a bit.)


Direct link Reply with quote
 

Wolfgang Jörissen  Identity Verified
Belize
Member
Dutch to German
+ ...
Whole words Jun 26, 2008

The "whole words" issue should not be a big deal, since Word has the "Search for whole words only" option in the Search/replace window. In the macro, this is reflected as .MatchWholeWord = True

Direct link Reply with quote
 

ahmadwadan.com  Identity Verified
Kuwait
Local time: 04:23
English to Arabic
+ ...
TOPIC STARTER
Great! Jun 26, 2008

Wolfgang Jörissen wrote:

... which produced this:

End Sub


Dear Wolfgang,

This is exactly what I need. It works for English text. Now I am working to apply this to Arabic text but Arabic characters appear scrambled (encoding issue) in Visual Basic Editor so it did not work for Arabic. I wish you have a solution for this.

Thank you so much


Direct link Reply with quote
 

Wolfgang Jörissen  Identity Verified
Belize
Member
Dutch to German
+ ...
Try recording it yourself Jun 26, 2008

That's all I did. Not sure about the exact commands in the English Word version, but AFAIK, it's Tools - Macro - Record.

Direct link Reply with quote
 

ahmadwadan.com  Identity Verified
Kuwait
Local time: 04:23
English to Arabic
+ ...
TOPIC STARTER
Codes for Arabic characters Jun 26, 2008

Wolfgang Jörissen wrote:

That's all I did. Not sure about the exact commands in the English Word version, but AFAIK, it's Tools - Macro - Record.


Yes, I tried this, but the problem with Arabic is that Macro replace Arabic characters with numbers so I can not know which is which. For example: you may find an Arabic word represented by a code "251897".

Thank you Wolfgang


Direct link Reply with quote
 

Wolfgang Jörissen  Identity Verified
Belize
Member
Dutch to German
+ ...
Maybe... Jun 26, 2008

Well, I am not an expert and my knowledge of Arabian is limited to Salam and Shukran, but maybe this helps? http://unicode.org/charts/PDF/U0600.pdf

Direct link Reply with quote
 

ahmadwadan.com  Identity Verified
Kuwait
Local time: 04:23
English to Arabic
+ ...
TOPIC STARTER
Just change font to view Arabic Jun 26, 2008

From Macro editor click Tools>>Options>>Edit Format>> then select an Arabic font on the right.

Kind regards


Direct link Reply with quote
 

Yaotl Altan  Identity Verified
Mexico
Local time: 20:23
Member (2006)
English to Spanish
+ ...
Macro Jun 26, 2008

Is it necessary a macro?
Maybe you onle y have to sustitute words in the Correction section.


Direct link Reply with quote
 
FarkasAndras
Local time: 03:23
English to Hungarian
+ ...
no Jun 26, 2008

No, Ahmad wants to correct his source texts, not the typos he himself makes.

By the way, than you for that, Wolfgang. I'll have to experiment with the macro recorder myself, too...


Direct link Reply with quote
 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Macro for correcting specific frequent spelling mistakes

Advanced search






PerfectIt consistency checker
Faster Checking, Greater Accuracy

PerfectIt helps deliver error-free documents. It improves consistency, ensures quality and helps to enforce style guides. It’s a powerful tool for pro users, and comes with the assurance of a 30-day money back guarantee.

More info »
WordFinder
The words you want Anywhere, Anytime

WordFinder is the market's fastest and easiest way of finding the right word, term, translation or synonym in one or more dictionaries. In our assortment you can choose among more than 120 dictionaries in 15 languages from leading publishers.

More info »



All of ProZ.com
  • All of ProZ.com
  • Term search
  • Jobs