4 % \KwResult{how to write algorithm with \LaTeX2e }
5 \SetKwProg{Def
}{def
}{:
}{}
6 register := $
\emptyset$\;
7 \While{there is another word
}{%
9 commonprefix := CommonPrefix(word)\;
10 laststate := delta
\textsuperscript{*
}(q0, commonprefix)\;
11 currentsuffix := word
[length(commonprefix)
\ldots length(word)
]\;
12 \If{has
\_children(laststate)
}{%
13 replace
\_or\_register(laststate)\;
15 add
\_suffix(laststate, currentsuffix)\;
17 replace
\_or\_register(q0)\;
20 \Def{replace
\_or\_register\_dawg(state)
}{%
21 child := last
\_child(state)\;
22 \If{has
\_children(child)
}{%
23 replace
\_or\_register(child)\;
25 \eIf{there is an equivalent state q
}{%
32 \caption{Generating DAWGs pseudocode
}
36 \subsection{scheme.xsd
}
39 \xmlcode[firstnumber=
51]{scheme2.xsd
}