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

ahmadwadan.com  Identity Verified
Kuwait
Local time: 02:55
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: 01:55
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: 02:55
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: 02:55
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: 02:55
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: 18:55
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: 01:55
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






Anycount & Translation Office 3000
Translation Office 3000

Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.

More info »
memoQ translator pro
Kilgray's memoQ is the world's fastest developing integrated localization & translation environment rendering you more productive and efficient.

With our advanced file filters, unlimited language and advanced file support, memoQ translator pro has been designed for translators and reviewers who work on their own, with other translators or in team-based translation projects.

More info »



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