-
Notifications
You must be signed in to change notification settings - Fork 4
ClimbShortClimb
SHORT-CLIMB is a tool that can create metagrammar libraries for a larger resource grammar. It provides a practical set-up to flip back and forth between different versions of a grammar. The approach can be used to (temporarily) maintain and explore an alternative analyses, or to collect standard differences between versions of a grammar (e.g. a more restricted version and a more robust version)
- Definitions related to a specific (alternative) analysis are located at one spot (clear overview of related properties)
- Revisions made to one version of the grammar can be included in the other version automatically (more systematic comparison between versions)
- SHORT-CLIMB libraries can be applied to the grammar at any time: may provide a good starting point to go back to an old analysis after a long time
-
SHORT-CLIMB can be obtained by contacting AntskeFokkens (the code can be downloaded directly soon)
-
Please send request, questions and bugs reports to AntskeFokkens by email (for bug reports: include your library and the to-be-modified TDL file)
- SHORT-CLIMB (short_climb.py) lives in a subdirectory of the grammar
- CLIMB libraries live in a subdirectory of the grammar called climb
- CLIMB libraries define which .tdl files must be manipulated: all other parts of the grammar will be copied
To change these defaults adapt the following lines in short_climb.py:
path = '../climb/'
gram_path = '../'
where gram_path should lead to the directory of the grammar and path to the directory of CLIMB libraries.
SHORT-CLIMB can insert and remove types, add new properties to types and remove properties from types. These operations are evoked from statements in CLIMB libraries. Examples are provided below
input=gram_part.tdl
states that gram_part.tdl should be included in the modification process. Statements regarding types that are defined in tdl files that are not defined as input will be ignored. I will use the term input files to refer to files defined as input below.
remove=type_name
removes all type definitions with type_name from the input files.
remove=type_name,addendum
removes all addenda to type with type_name from the input files.
location=type_name
my_new_type := supertype &
[ PATH.FEATURE value ].
inserts the definition of my_new_type above the type definition of type_name in the grammar. If type_name is removed by another statement, my_new_type will replace the old type. If type_name does not occur in any of the input files, the statement will be ignored. location=type_name followed by a tdl definition can also be used to insert addenda.
type_name := new_supertype &
[ NEW_PROPERTY new_value ].
adds new_supertype as a supertype and [ NEW_PROPERTY new_value ] as a new value to the definition of type_name. If type_name does not occur in the input files, this definition will be ignored. (A location must be defined to insert completely new definitions)
type_name :+ new_supertype &
[ NEW_PROPERTY new_value ].
will add these properties to the addenda of type_name. If type_name does not have an addendum yet, it will be created. If type_name does not occur at all in the input files, this statement will be ignored. (A location must be defined to insert completely new definitions)
type_name :- old_supertype &
[ OLD_PROPERTY old_value ].
removes the supertype old_supertype and constraint [ OLD_PROPERTY old_value ] from type type_name. As for the above: this statement is ignored if type_name does not occur in the input files. Careful with lists and diff-lists:
- If the only type or constraint of a list is removed, the entire list is removed
- Properties of elements on a list can be removed, but an element cannot be removed completely from the list
type_name :- [ MY-DLIST <! [ ], old_type, [ ] !>
removes the constraint old_type from the second element on the diff-list. Other constraints on this element will be maintained. If no other constraints are defined, it will be replaced by [ ] in the new grammar. The first and last element on the diff-list will remain untouched
type_name :- [ MY-DLIST <! [ ], [ OLD_C old_v ], [ ] !>
removes the feature-value pair [ OLD_C old_v ] from the second element on the diff-list. Again, other constraints on this element will be maintained and it will be replaced by [ ], if [ OLD_C old_v ] was the only constraint defined on the second element and no specific type was given for it.
NB. To change the number of elements on a list, use the complete replacement option (see below)
complete=on
type_name := supertype &
[ SOME_CONSTRAINT value ].
replaces the type definition of type_name in the original grammar by the new definition below.
Home | Forum | Discussions | Events