A computer-implemented method for language generation of a flow diagram, which receives a flow diagram. A plurality of geometric shapes within the flow diagram is identified. A plurality of text elements within the flow diagram is identified. The plurality of text elements and corresponding geometric shapes are associated. The association between the plurality of geometric shapes are identified. A diagram matrix based on the associations between the plurality of geometric shapes is generated. A linear language representation of the diagram matrix is generated.