Piece
What a reader reads in one sitting: a sonnet, a stanza, a scene.
Creating or decoding a piece refuses cuts that do not divide its lines: each stage named in cutSizes has to be a reading stage other than ReadingStage.LINE, and its sizes have to be positive and add up to exactly the number of lines. The number is not validated against a work.
Throws
, WorkCorpus.WorkShapeError.CutsForLineStage, WorkCorpus.WorkShapeError.EmptyCut or WorkCorpus.WorkShapeError.CutsDoNotCoverThePiece naming the piece and the stage when the cuts do not divide the lines, the stages judged in code-point order of their names.
naming the field when the number or a cut size decoded from YAML or JSON is not a whole number within 32 bits.
naming the field when a decoded title or line is null.
when a decoded piece misses a field or a field holds another kind of value than it names.