2 min read

An Online Latin to English Translator via SAS

Last month I submitted piece of SAS codes for a monthly programming challenge hosted by Jian Dai to translate the Latin motto of Hogwarts School in Harry Potter into English__:

draco dormiens nunquam titillandus

You can get the meaning using Google search of course—but not in Google Translator (Google Translator can’t recognize all of such Latin words!). Jian posted a concise Perl way to parse webs which contain this Latin phrase and key words “mean”,  “means” and such and you can always find page like

“draco dormiens nunquam titillandus,” which means “never tickle a sleeping dragon.”

My SAS approach can’t return a human readable sentence like this one but a 100% word to word machine translation and you can use it to translate any Latin sentence which happens not appear in any singe web page. The usage is also very simple:

filename L2E url ‘http://jiangtanghu.com/docs/en/Latin2Eng.sas’;

%include L2E;

%Latin2Eng(draco dormiens nunquam titillandus)

and you get:

Obs   draco         dormiens                               nunquam                         titillandus

1    dragon    sleep, rest                 at no time, never            tickle, titillate, provoke
2     snake     be/fall asleep          not in any circumstances     stimulate sensually
3                   behave as if asleep
4                   be idle, do nothing

and also (2*4*2*2=) 32 Cartesian combinations to feel the meaning if needed.

Then you can also test the words by Julius Caesar:

%Latin2Eng(Veni Vidi Vici)

and get:

Obs   Veni       Vidi                                                                     Vici

1     come    see, look at                                                     conquer, defeat, excel

2                 consider                                                           outlast

3                (PASS) seem, seem good, appear, be seen      succeed

This SAS translator is based on WORDS (version 1.97FC) by William Whitaker and the codes still needs some modifications when any unexpected special symbols popped up in the translating page.