Make all Form IDs absolute, including the parents Lexeme ID

Authored by thiemowmde on Tue, Nov 14, 4:58 PM.

Description

Make all Form IDs absolute, including the parents Lexeme ID

Note there are FIXMEs in this patch:

  • How can FormGenerator generate a FormId if it does not know anything about it's parent?
  • I had the same issue in Lexeme::addForm, but was able to work around it by throwing an exception if the parent Lexeme does not have an ID yet.

Besides, I was a little suprised how easy this change became the moment I
teached the NewForm class to kindly accept partial Form IDs (in the short
form "F1").

I also learned there are a few places in the code that currently violate
the contract of always exposing the full ID (e.g. "L1-F2"), but never the
short form (e.g. only "F1"):

  • The FormSerializer currently violates this contract, because all it does is outputting what FormId::getSerialization returns.
  • Automatic summary lines also violate the contract.

Bug: T180464
Change-Id: I342d62996f3fc539c20a7b998b14c4b7add11791

Details

Committed
thiemowmdeTue, Nov 14, 5:19 PM
Parents
rEWLEbd18abd7819f: Extract FormId regex pattern into a constant
Branches
Unknown
Tags
Unknown
References
refs/changes/44/391244/2
ChangeId
I342d62996f3fc539c20a7b998b14c4b7add11791