Showing posts with label Wikipedia. Show all posts
Showing posts with label Wikipedia. Show all posts

Jan 10, 2014

memoQ AutoCorrect update & MS Word export macro

Last summer I wrote about autocorrection of text in memoQ and offered an indexed embedding of a video I created to give an overview of the AutoCorrect functions in memoQ 2013. There have been a few enhancements since then in memoQ 2013 R2; where only "smart quote" toggling was possible before there are now various options for correcting accidental miscapitalization.

I've also been looking to optimize the procedure for migrating the Microsoft Word autocorrection lists to memoQ. There are a number of problems with using the table-generating macro that Kilgray suggests in the knowledgebase article on using MS Word 2003 autocorrect data; when I created a 17,000 entry list from a large AutoCorrect file for one language, it was nearly impossible to do anything with it because of memory problems. The following macro, which could be put into the Normal template in MS Word, should be a little easier to work with:
Sub BuildAutoCorrectList()
  Dim ACE As AutoCorrectEntry
  ' Create new document.
  Documents.Add
  ' Iterate through AutoCorrect entries.
  For Each ACE In Application.AutoCorrect.Entries
    ' Insert each entry name and its value on a new line.
    Selection.TypeText ACE.Name & vbTab & ACE.Value & vbCr
  Next
End Sub
Invoke the macros dialog in MS Word with Alt+F8. Select the Normal.dot or Normal.dotm file (depending on your version of MS Office) from the dropdown list, enter the name of the new macro and click the Create button. Then paste in the code above. When the macro is run, it will create a new document with the autocorrection list in tab-delimited text. To bring the list into memoQ, you'll have to
  1. Paste in the XML header needed by the "light resource" for AutoCorrect lists in memoQ. You can see what this looks like for the language setting you want by creating a dummy resource, exporting it and opening the file with a text editor. European Spanish might look like this, for example:
    <MemoQResource ResourceType="AutoCorrect" Version="1.0">
      <Resource>
        <Guid>6d61e3bc-da00-4cb8-a4f3-93c980543bba</Guid>
        <FileName>spa-ES#EU Spanish AutoCorrect.mqres</FileName>
        <Name>European Spanish</Name>
        <Description />
        <Language>spa-ES</Language>
      </Resource>
    </MemoQResource>
     
  2. Save the file as plain text with UTF-8 encoding.
  3. Change the file extension to "*.mqres"
  4. Import the resource to memoQ.
AutoCorrect lists which are language-neutral (for example, lists of company names) use "all#" in the name and "Neutral" between the tags.

Other sources for autocorrection data
With a bit of searching, one can find other sources of data to add to AutoCorrect resources for various language. Wikipedia, for example, offers lists of commonly misspelled words, such as this one in English, which includes links to Dutch, Hungarian, Portuguese, Spanish and Turkish lists. The structure of the data lends itself easily to reformatting with the search and replace features of a text editor:
alamanya->almanya
aferim->aferin
agrasif->agresif
ağostos->ağustos
ahret->ahiret
ayle->aile
alarım->alarm
atmış->altmış
Copy the data from the Wikipedia page to a text file. Then use search and replace to substitute tabs for the "->" structures, add an appropriate XML header for the memoQ resource and save the file as UTF-8 with an MQRES extension and you have an AutoCorrect list ready for import to memoQ. An example of the Turkish list converted and ready for use in memoQ is available for download here.

For German, there is a list of common spelling errors on Wikipedia which can be adapted with very little effort to make this resource.

The English list on the Oxford Dictionaries page can also be adapted without much ado. And there are many others to be found on the Internet.

Merging memoQ AutoCorrect resources
Entries from multiple AutoCorrect lists can be combined in a single tab-delimited file, and duplicates can be removed using Microsoft Excel, for example.

The screenshot above shows a merged German AutoCorrect list opened in Excel. When using the Remove Duplicates function on the Data ribbon, be sure that only Column A is selected in the dialog:


The reason Column B must not be selected is that it contains the desired text after correction, and there may be more than one error entry for a particular word.

After duplicates have been removed from the list, save the file as Unicode text, then import it to memoQ. A similar procedure with Excel may be followed to maintain other memoQ light resources; I do this rather frequently for segmentation exceptions to ensure that the lists for the different language variants I work with remain synchronized. (It would be nice, of course, if Kilgray would create a reasonable light resource manager with such capabilities. It gets tiring to do this so often with stopword lists and other resources.)

Jan 17, 2012

The Great Firewall of Washington!

Slowly I am beginning to understand the association of the color red with the Republican Party in the United States. Before the 2000 presidential election, red and blue had no fixed association with Democrats or Republicans, and when I thought of the color red at all in the years after that I was usually seeing red because of Republican policies designed to dismantle the country or all the blood, foreign and domestic, which Republican lawmakers and Republican wannabes like "blue dog" Democrats so happily see shed. But slowly the truth is emerging from the fog of the Bush wars: the Chinese connection. Ol' Shrub & Co. happily financed their military adventures with Chinese money, now it seems that Republican lawmakers, following the lead of their Red Chinese masters, want to erect a Great Firewall in Washington to strangle free expression. Beijing disapproves of dangerous ideas like the First Amendment to the US Constitution, so their eager Red Party students in the US House of Representatives and Senate SOPA and PIPA respectively to set things right, based on the hollow premise of preventing copyright violation. President Obama has stated his opposition to the legislation now proposed; let's hope he doesn't roll over and play dead for the Reds as he is wont to do.

As part of the protest against US legislators' attempts to strangle free expression through unconstitutional preemptive restraints and other measures, Wikipedia will be blacking out its English pages worldwide tomorrow. Wikipedia, like any other Internet-based platform exists within and is affected by the framework of laws, and I find it entirely appropriate that this otherwise neutral platform stand up and take a position in this matter. Details regarding the blackout, scheduled to begin at 5:00 am UTC on January 18, 2012 and continue for 24 hours, will be found here.

We as translators depend very often on the public availability of information for our work. Intellectual property should have appropriate protection, but the Stop Online Piracy Act (SOPA) in the U.S. House of Representatives, and the PROTECT IP Act (PIPA) in the U.S. Senate are not the way forward. If you are a US voter, please make this clear to your erected representatives.

Oct 16, 2011

All the myriad "languagepedias" compared

Another useful tip from the latest ToolKit newsletter by Jost Zetzsche is about a multilingual Wikipedia listing comparison tool, Manypedia. It provides a simple interface for comparing entries in any two specified languages, for example to get a quick overview of relevant terminology.



The screenshot above is one I made comparing pages I used to read up on the disease that nearly killed my dog last week, two days after he passed all his hunting utility qualifications for Germany. (He is now on the mend after several harrowing days and a few pointed discussions with the veterinary clinic where he was first misdiagnosed, then given the wrong treatment when the tick-borne parasites were identified.)

This is an extremely useful tool for me, and I like the comparison of side-by side text displays in the two languages. I do in fact often use Wikipedia to get a "feel" for comparative terminology in subject areas, so I will be making use of this.