Table of Contents

Class NcPieceTextUtil

Namespace
Hi.NcParsers.NcWriteback
Assembly
HiMech.dll

Stage two of the two-stage NC writeback pattern — the reverse of an ISegmenter: walks a destination SyntaxPiece stream and emits its BlockTexts as NC text lines, splitting a multi-line block back into its original lines. Byte-level fidelity (newline style, EOF newline, encoding) is owned by the serialization layer that writes the lines.

public static class NcPieceTextUtil
Inheritance
NcPieceTextUtil
Inherited Members

Methods

ToLines(IEnumerable<SyntaxPiece>)

Emits the text lines of syntaxPieces in stream order. A piece without a Sentence is skipped; a block whose text spans multiple lines yields one string per line (BlockText joins them with the environment newline, so '\r' is trimmed from split ends).

public static IEnumerable<string> ToLines(IEnumerable<SyntaxPiece> syntaxPieces)

Parameters

syntaxPieces IEnumerable<SyntaxPiece>

Returns

IEnumerable<string>