\section{Algorithm for Statement Extraction}
\label{appndix:tablecellannotation}

We present the algorithm we used to extract statements. For this algorithm, the inputs are the original table and the labels table.

\begin{algorithm}
\small
\begin{algorithmic}[1]
\Procedure{Extract Statements}{Table, LabelsTable}
\State \textbf{Input:} Table, LabelsTable: Table and Table of cell annotations
% \State \textbf{Output:} AllStatements: list
\State AllStatements $\gets$ empty list
\ForAll{row in LabelsTable}
\ForAll{column in LabelsTable}
\If{LabelsTable[row][column] = Property Value}
\State \textbf{Search in the same row and column} for (Sub)-Property
\If{Property is found}
\State \textbf{Append Headers} in hierarchy to Property, if any, starting from the minimum level
\State \textbf{Construct Statement} with Property, Row and Column
\ElsIf{SubProperty is found}
\State \textbf{Append Property} to the SubProperty
\State \textbf{Append Headers} in hierarchy to SubProperty, if any, starting from the maximum level
\State \textbf{Construct Statement} with SubProperty, Row and Column
\Else
\State Property is not found, continue to the next iteration
\EndIf
\State Append Statement to AllStatements
\EndIf
\EndFor
\EndFor
\State \textbf{Return} AllStatements
\EndProcedure
\label{alg:statement_extraction}
\caption{Extract Statements}
\end{algorithmic}
\end{algorithm}

\begin{algorithm}
\small
\begin{algorithmic}[1]
\Procedure{Construct Statement}{Row, Column, Property}
\State \textbf{Input:} Row, Column, Property: Row and Column of the Property Value, with its related Property
\State \textbf{Output:} Statement: list
\State Statement $\gets$ empty list
\State Predicate $\gets$ empty dictionary
\State Predicate [Property Value] $\gets$ \text{Table}[Row][Column]
\State Predicate [Property] $\gets$ Property
\State \textbf{Search in the same row and column}(Unit Value)
\State Predicate[Unit] $\gets$ Table[row$\sb{uv}$][column$\sb{uv}$]
\State \textbf{Search for a } Subject - Subject Value \textbf{ pair}
\State Predicate[Subject] $\gets$ Table[row$\sb{s}$][column$\sb{s}$]
\State Predicate[Subject\_Value] $\gets$ Table[row$\sb{sv}$][column$\sb{sv}$]
\State Add Predicate to the Statement
\State \textbf{Search in the same row and column}(Time Value)
\If{Time Value is found}
\State Predicate $\gets$ empty dictionary
\State Predicate [Property Value] $\gets$ \text{Table}[row$\sb{tv}$][column$\sb{tv}$]
\State Predicate [Property] $\gets$ "Time"
\State Add Predicate to the Statement
\EndIf
\State \textbf{Search for all} Key - Key Value \textbf{pairs}
\ForAll{Key - Key Value pairs found}
\State Predicate $\gets$ empty dictionary
\State Predicate[Property] $\gets$ Table[row$\sb{k}$][column$\sb{k}$]
\State Predicate[Property Value] $\gets$ Table[row$\sb{kv}$][column$\sb{kv}$]
\State Add Predicate to the Statement
\EndFor
\State \textbf{Return} Statement
\EndProcedure
\end{algorithmic}
\end{algorithm}

\begin{algorithm}
\small
\begin{algorithmic}[1]

\Procedure{Append Headers}{Row, Column, Propery, Level}
\State \textbf{Input:} Row, Column, Property, Level: Row, Column, value of a Property cell and the level of the header to search for.
\State \textbf{Output:} Property: string
\ForAll{Row$\sb{a}$ above Row}
\ForAll{Column$\sb{l}$ on the left of Column}
\If{LabelsTable[Row$\sb{a}$][Column$\sb{l}$] is a header with a higher level than Level}
\State Append Table[Row$\sb{a}$][Column$\sb{l}$] on top of Property
\If{the level of LabelsTable[Row$\sb{a}$][Column$\sb{l}$] is maximum}
\State \textbf{Return} Property
\Else
\State \textbf{Append Headers} in hierarchy to Property starting from the level of LabelsTable[Row$\sb{a}$][Column$\sb{l}$]
\State \textbf{Return} Property
\EndIf
\EndIf
\EndFor
\EndFor
\State \textbf{Return} Property
\EndProcedure
\caption{Utility function for appending section header.}
\end{algorithmic}
\end{algorithm}


\begin{algorithm}
\small
\begin{algorithmic}[1]
\Procedure{Append Property}{Row, Column, SubProperty}
\State \textbf{Input:} Row, Column, SubProperty: Row,Column and Value of a SubProperty cell
\State \textbf{Output:} Subproperty: string
\ForAll{Row$\sb{a}$ above Row}
\ForAll{Column$\sb{l}$ on the left of Column}
\If{LabelsTable[Row$\sb{a}$][Column$\sb{l}$] is a Property}
\State Append Table[Row$\sb{a}$][Column$\sb{l}$] on top of SubProperty
\State \textbf{Return} SubProperty
\EndIf
\EndFor
\EndFor
\State \textbf{Return} SubProperty
\EndProcedure
\caption{Utility function for appending property name to sub-property}
\end{algorithmic}
\end{algorithm}

\begin{algorithm}
\small
\begin{algorithmic}[1]


\Procedure{Search in the same row and column}{Row, Column, Key}
\State \textbf{Input:} Row, Column, Key: Row and Column where to search the specified Key
\State \textbf{Output:} Row$\sb{k}$, Column$\sb{k}$: Row and column of the designated Key, if found
\ForAll{Cell respectively on the Left, Above, and Right to the cell at LabelsTable[Row][Column]}
\If{Cell is Key}
\State \textbf{Return} Row, Column of Cell
\EndIf
\EndFor
\State \textbf{Return} Null
\EndProcedure
\caption{Utility function to search for related predicates}
\end{algorithmic}
\end{algorithm}

\begin{algorithm}
\small
\begin{algorithmic}[1]

\Procedure{Search for a pair}{Row, Column, Key, Key Value}
\State \textbf{Input:} Row, Column, Key: Row and Column where to search the specified Key
\State \textbf{Output:} Row$\sb{k}$, Column$\sb{k}$: Row and column of the designated Key, if found
\ForAll{Cell$\sb{kv}$ respectively on the Left, Above, and Right to the cell at LabelsTable[Row][Column]}
\If{Cell$\sb{kv}$ is Key Value}
\ForAll{Cell$\sb{k}$ in the Orthogonal Direction with respect to Cell$\sb{kv}$ from LabelsTable[Row][Column]}
\If{Cell$\sb{k}$ is Key}
\State \textbf{Return} Coordinates of Cell$\sb{k}$, Cell$\sb{kv}$
\EndIf
\EndFor
\EndIf
\EndFor
\State \textbf{Return} Null
\EndProcedure
\caption{Utility function for searching corresponding key-value.}
\end{algorithmic}
\end{algorithm}
