Apertium

Represent Constraint Grammar as a Python class

The idea of this task is to represent Constraint Grammar (in the sense of it being a file) as a Python class. There has been similar work done for at least Haskell (https://github.com/inariksit/cghs/blob/master/src/Rule.hs), though it only represents rules. Here we should represent the whole Constraint Grammar file as a Python class. However, in this task you only need to do a draft of the different parts of Constraint Grammar.

Here's what you should at least do:

class CG – the main class representing Constraint Grammar file. It can have for example rules inside it.

class Rule – representing all sorts of Constraint Grammar rules

class Select/Remove – an actual rule (pick one rule of your choice)

All of the classes should have a string representation made for them (when just it makes sense).

The formal grammar for visl-cg3 is here.

Task tags

  • python
  • constraint grammar
  • grammars
  • cg

Students who completed this task

nuboro

Task type

  • code Code
close

2016