delph-in / matrix

The Grammar Matrix

Home Page:https://matrix.ling.washington.edu/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

user guide for grammar maintainers

arademaker opened this issue · comments

In the PorGram, we are discussing alternatives to maintain the TDL files that were manually edited by us without blocking future extensions of the grammar with the Matrix. For now, we have been using the prefix my- to customize files and keep the files generated by the Matrix untouched. See https://github.com/LR-POR/PorGram/tree/issue-77. But this approach proliferates the files and makes the whole grammar harder to read/understand, maybe... Do you guys recommend any alternative approach? @emilymbender mentioned in the last summit that copying files would not be necessary, but we didn't have time to discuss alternatives.

Maybe git version control would be enough to solve conflicts between the manual changes and the Matrix new versions? Ideas?

I don't really understand why this discussion is here, rather than on the delphinqa site, and what you are asking for is I guess a textbook of sorts? That is not something that I conceive of as part of what is stored here (the Matrix source code).

At any rate: The way the Matrix is conceptualized, we hope that no edits are needed to matrix.tdl or the other files in the core grammar, but portuguese.tdl etc should be directly editable. If you are concerned about merging in changes that come from revisiting the customization system, I see two cases where that arises:

  1. You've made edits to your choices file and gotten a new customized grammar
  2. The customization system itself has changed, and is outputting different tdl for the same grammar specification

For (1) what I recommend is creating two new grammars, one with the old choices file and one with the new, and then diffing those two. That will tell you what changes to merge into your main grammar.

For (2), it's a bit trickier, since the earlier version of the customization system likely wouldn't be available to you. You can plan for it, though, by checking in snapshots of customized grammars each time you work from one, and use the most recent one of those as a diff target.