I am going to write a pseudo-code using the algorithm package. Everything is fine, however, I am not able to automatically break lines and you see what happens in the picture below:
I am wondering how I can break lines in my pseudo-code automatically when I am using algorithm package. Is there any other better alternative for algorithm package in order to write pseudo-codes?
Here is my code:
\begin{algorithm}
\caption{Bootstrapping algorithm for seed expansion}
\label{algorithm:expansion}
\begin{algorithmic}[1]
\Procedure{ExpandSimpleByPMI}{}
\BState \emph{Input}:
\State ${(S_{p}, S_{n})} \text{ : seed set for the Positive and Negative categories}$
\State ${G_{rel}} \text{ : graph defined on terms by the lexical relation \textit{rel}}$
\State ${S_{rel}} \text{ : boolean flag specifying if the relation expresses similarity of opposition of orientation}$
\BState \emph{Output}:
\State ${(S_p^{'}, S_n^{'})} \text{ : expanded seed set}$
\BState \emph{Body}:
\State $\text{1. } S_p^{'} \leftarrow S_{p} \text{ ; } S_n^{'} \leftarrow S_{n}$
\State $\text{2. foreach term in } S_{p} \text{ do}$
\EndProcedure
\end{algorithmic}
\end{algorithm}
