begin{algorithm}
\SetAlgoLined
\DontPrintSemicolon
\KwIn{$ NPs $\Comment*[r]{All Noun Phrases of D}}
\KwOut{$ {NPs}^{'}$ \Comment*[r]{NPs without PHIs}}
\SetKwFunction{Fun}{PHIsDetection}
\Fun{$NPs, PHIS$}{
$PHIs \longleftarrow Legislations(HIPAA, i2b2, MIMIC) $;
${NPs}^{'}\longleftarrow NPs $;
\ForEach{$ NP \in NPs $}{
\If{$ NP_j \in PHIs $}
{$ NPa_j \longleftarrow g(NP_j) $;}
}
\Return ${NPs}^{'} $
}
\caption{Algorithm for Detection of PHIs}
\label{PHIDetectionAlgo}
\end{algorithm}
生成的代码:
答案1
\begin{algorithm}[H]
\SetAlgoLined
\DontPrintSemicolon
\KwIn{$ F $\Comment*[r]{List of Sensitive Terms}}
\KwOut{$ S^{*} $ \Comment*[r]{Negation Excluded List}}
\SetKwFunction{FMain}{NegationDetection}
\SetKwProg{Fn}{Function}{:}{}
\Fn{\FMain{$F$}}{
$ S^{*} \longleftarrow F $;
\ForEach{$ F \in NPs $}
{\eIf{$ f_i = Negated $}
{$ N \longleftarrow f_i;$}
{$ S \longleftarrow f_i;$}
}
\textbf{return} $ S^{*}; $
}
\textbf{End Function}
\caption{Algorithm for Excluding the Negation}
\label{NagetionAlgo}
\end{algorithm}