English to Norwegian Translator 


I
was recently in Norway and took time to work on Timbre. While
most people there spoke english as a second, I wanted a way to work
with and remember the words and phrases I was learning. I got up
early one morning and put together a simple Norwegian/English
translator with a few extras. It is a useful framework to build a
language translator upon. My intent was to help me with everyday
phrases and words and ease me into the pronunciation of Norwegian words
and the three extra letters. Just writing the language translator
made me more familiar with the language and was the most valuable
exercise for me. In a way it was capturing the way I learned to
speak Norwegian and could serve as a learning record. As my
studies progressed, so would the translator.
There are two useful behaviours that I wanted to capture:
• enter an english word or phrase and see the norwegian equivalent
• enter a word or phrase in english or
norwegian and see how it is pronounced in norwegian
The default
behaviour is the first one, while the second behaviour can be elicited
by preceding the phrase or word with either 'pronounce' or '?' without
the quotes. The dictionary structure uses two rule sets.
One for translation and the other for pronunciation.
Example session run on a Mac OS X terminal with Timbre V.9 installed (output is bold):
$: timbre english2norwegian.tim
English to Norwegian translation
type words in lower case; press esc to exit
> hello hallo
> pronounce hallo hah-loo
> ? monday mahn-dah
> I don't understand Jeg forstår ikke
> ? I don't understand ay fo-shtaw ik-ker
> <esc> bye
$: