\begin{algorithm}[!t]
\newcommand{\Break}{\State \textbf{break} }
\caption{\small Emotion-cause prefixes correction for $u_{text}$}
\label{alg:rule-based-method}
\small
\begin{algorithmic}
\State $updated \gets True$
\State $V_{p}^{'} \gets \text{sorted}~V_{p}~\text{by decreased entry lengths in words}$
\While{$u_{text} \neq \varnothing$ \textbf{or} $updated$}
    \State $updated \gets False$
    \State $u'_{text} \gets u_{text}$ \Comment{Modified version of $u_{text}$}
    \For{$v_{p} \in V_{p}^{'}$} 
        \If{$u_{text}$ ends with $v_{p}$}
            \State $u'_{text} \gets \text{part of}~u_{text}~\text{before}~v_{p}$
            \State $updated \gets True$
            \Break
     \EndIf \EndFor \EndWhile
\end{algorithmic}
\end{algorithm}