What are Runtime Rules?


Language Studio™ Enterprise Runtime Rules provide a means to modify the translation dynamically at runtime, forcing the translation engine to bias the output towards the terms specified in the runtime glossary.


Runtime rules are a very simple format, with the source and target term separated by a tab. Each runtime rule can have multiple lines and each rule should be separated by a new line.


Runtime rules are absolute. If the specified term is found, it will override the statistical engine and be used in the translated output.


There are four types of Runtime rules, which are explained below.


What Runtime Rules can be added


There are four runtime rules that can be added to the engine at runtime.


1. PPre-Translation Correction (PTC):

Language Studio™ allows for the adjustment of terminology so that source terms are corrected before translation. Pre-Translation Corrections can also correct known errors such as spelling mistakes, common OCR errors, glued words, etc. Often the original source material may contain outdated terminology. For example, user-generated content may have common spelling errors that can be modified to the correct spelling.


2. RRuntime Glossaries (GLO):
Language Studio™ allows glossaries to be defined on a customer, project and job level. Having a term specified to the translation that is important for the domain. Specifying a term that can have different meanings when translated as individual segments, in contrast to a whole term, i.e. real and estate differs in meaning to real estate as a whole term.


3. NNon-Translatable Terms (NTT):
Some terms such as product names, venue names, etc. should not be translated. Language Studio™ allows a list of non-translatable terms to be specified.


4. PPost-Translation Adjustments (PTA):

Statistics may determine a preferred term based upon the training data provided. A preferred term for one customer may not be the preferred term for another customer. One of our clients has 2 clients of their own in the commercial real-estate business. One prefers to call some buildings by their older name, while the other prefers the new name. A single engine can be used, with a Post-Translation Adjustment making the necessary change for each specific customer.


When To Use A Runtime Rule


Runtime rules are not a permanent solution, they offer a temporary solution for a quick fix or change. They are useful when a new version of the engine has yet to be trained.


How to Create A Runtime Rule


A Glossary is built using a Text Editor such as Notepad++. The file is built and saved as a .txt file in UTF-8 format.


How to Write A Runtime Rule


For the runtime rule, there are three columns, apart from an NTT, which has just the two.



source term 1<TAB>target term 1<TAB>rule

source term 2<TAB>target term 2<TAB>rule

source term 3<TAB>target term 3<TAB>rule




source term 1<TAB>rule

source term 2<TAB>rule

source term 3<TAB>rule



Case Sensitive


Application of a rule can be either Case Sensitive (CS) or Case Insensitive (CI) on the Source.


By default the Source side is CS. The Target side is also case sensitive. Language Studio™ has a special feature to allow case sensitivity to be specified by the user.


The third column in a rule can set the Case Sensitivity of the Source, by using CS, CI, Null (no value given).


A rule has one of the following values:


cs: case sensitive

ci: case insensitive

rcs: regex case sensitive (for PowerTool users)

rci: regex case insensitive (for PowerTool users)




brown sugar<TAB>azúcar moreno<TAB>ci


Sorting The File


To ensure that some patterns do not break other patterns make sure that you sort the rules by the length of the source search pattern with the longest at the top.



metallic plate<tab>placa metálica<tab>ci





metallic plate<tab>placa metálica<tab>ci


Example of a glossary:


Saving The File


Important Note - When the file is complete sorted and saved, exit the file and change the file extension to .ptc .ntt .glo .pta. as appropriate.






How to Set A Runtime Rule


The Glossary is then uploaded into Language Studio™ Run-time Rules page, found in the Translation tab, and must be applied to the relevant translation engine and project.

The runtime rule is uploaded to the relevant place. For example, a glossary will be uploaded to the GLO section by clicking on Upload.


The file for translation can now be run with the rule set.


To remove the rule, just select the rule from the above page and press Delete.