Translation using spawning
Same events as translation using dictionary.
The monitor:
monitor Translator {
action onload() {
Translation t;
on all Translation():t addTranslation(t);
Input i;
on all unmatched Input():i fail(i);
}
action addTranslation(Translation t) {
spawn translation(t);
}
action translation(Translation t) {
on all Input(t.raw) translate(t.converted);
}
action translate(string converted) {
emit Output(converted);
}
action fail(Input i) {
print "Cannot translate: " + i.value;
}
}
Copyright © 2013
Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.