From Apertium
< Lttoolbox
Revision as of 07:19, 26 October 2017 by Unhammer (talk | contribs)
Jump to navigation Jump to search

r="LR" in an lttoolbox .dix file means "only include this entry when compiling from left-to-right" (lt-comp lr foo.dix foo.bin). Similarly, r="RL" in an lttoolbox .dix file means "only include when compiling from right-to-left".

In a monolingual dictionary, LR is used when several forms have the same analysis, but only one should be generated; e.g. if you want "colour" and "color" to have the same analysis <code>colour<n><sg></code>, but only "colour" to be generated, you would put r="LR" on "color".

An RL restriction is used in monodix for forms that should only be generated; one example would be where a single monodix is used for two language pairs which have slightly different tagsets, we might put an RL on an entry that's got the non-standard tagging; another example is when translating e.g. an adverb into some phrase that doesn't quite exist as a single adverb in the target language, we might put an RL on the entry since it shouldn't be analysed when translating into other languages.

In bidix, LR and RL are used when you want to translate only from the one language to the other. If the bidix has <code><l></code> for Spanish and <code><r></code> for Catalan, then any entries marked LR will only be included when you compile it "lr", from Spanish to Catalan (and RL entries are ignored). Similarly, RL entries are only included when you compile it "rl", from Catalan to Spanish (and LR entries are ignored).

When using lt-expand, an entry with r="LR" in the .dix will get :>: between the l and r when expanding, RL gets :<:, others get :.