Difference between revisions of "A long introduction to transfer rules"

From Apertium
Jump to navigation Jump to search
Line 9: Line 9:
* There are no recursive rules. Rules match fixed-length patterns. There is no optionality at the level of words. There is no way of saying one-or-more, it's just one.
* There are no recursive rules. Rules match fixed-length patterns. There is no optionality at the level of words. There is no way of saying one-or-more, it's just one.
* Apertium's rules are very tied to the [[Apertium stream format]]. If you don't understand the stream format, you it will be a lot more difficult to understand the rules.
* Apertium's rules are very tied to the [[Apertium stream format]]. If you don't understand the stream format, you it will be a lot more difficult to understand the rules.
* Rules contain both ''declarative'' parts and ''procedural'' parts. You can't just expect to say ''what'' you want or ''how'' you want to do it. You need to do both.
* Rules contain both ''declarative'' parts and ''procedural'' parts. You can't just expect to say ''what'' you want or ''how'' you want to do it. You need to do both -- but in different places.


==Lexical transfer and structural transfer==
==Lexical transfer and structural transfer==

Revision as of 16:03, 30 September 2012

Writing transfer rules seems to be tricky. People generally understand the basic concepts, but they struggle with the formalism. We think the formalism isn't that bad. And compared to many other formalisms,[1] it's fairly straightforward. Maybe one of the reasons people struggle is that we mix declarative and procedural programming. Could be.

Some formalities

Before starting, it is important to give some idea of what we can't do, before explaining what we can. If you come at rule-learning expecting something else, then it's likely to be confusing.

  • There are no recursive rules. Rules match fixed-length patterns. There is no optionality at the level of words. There is no way of saying one-or-more, it's just one.
  • Apertium's rules are very tied to the Apertium stream format. If you don't understand the stream format, you it will be a lot more difficult to understand the rules.
  • Rules contain both declarative parts and procedural parts. You can't just expect to say what you want or how you want to do it. You need to do both -- but in different places.

Lexical transfer and structural transfer

Overview of a transfer file

Apertium 1

Otisla si tiho i bez pozdrava

Lexical transfer

Apertium 3

Resorni je ministar navlačio ljude, kaže sejte biljku zelenu i čudo će da bude

Lexical transfer

Notes

  1. e.g. Matxin, OpenLogos, ...