in src-csharp/TextractExtensions/Cell.cs [6:40]
public Cell(Block block, Dictionary<string, Block> blocks) {
if(block == null)
return;
this.Block = block;
this.ColumnIndex = block.ColumnIndex;
this.ColumnSpan = block.ColumnSpan;
this.Confidence = block.Confidence;
this.Content = new List<dynamic>();
this.Geometry = block.Geometry;
this.Id = block.Id;
this.RowIndex = block.RowIndex;
this.RowSpan = block.RowSpan;
this.Text = string.Empty;
var relationships = block.Relationships;
if(relationships != null && relationships.Count > 0) {
relationships.ForEach(r => {
if(r.Type == "CHILD") {
r.Ids.ForEach(id => {
var rb = blocks[id];
if(rb != null && rb.BlockType == "WORD") {
var w = new Word(rb, blocks);
this.Content.Add(w);
this.Text = this.Text + w.Text + " ";
} else if(rb != null && rb.BlockType == "SELECTION_ELEMENT") {
var se = new SelectionElement(rb, blocks);
this.Content.Add(se);
this.Text = this.Text + se.SelectionStatus + ", ";
}
});
}
});
}
}