figure-example-of-dfs-extension-method.tex 5.25 KB
Newer Older
1 2 3
\begin{tikzpicture}	
	\tikzstyle{unit} = [inner sep=1pt,align=center,minimum width=3.5em,minimum height=2em,font=\large]
		
4 5
	\node[fill=red!40,inner sep=2pt,minimum width=5em](vocab)at(0,0){\color{white}{\small\bfnew{词表}}};
	\node[fill=red!20,anchor=north,align=left,inner sep=3pt,minimum width=5em](words)at(vocab.south){I\\[-0.5ex]agree};
6
	\node[fill=blue!40,anchor=north,align=left,inner sep=2pt,minimum width=5em](spe)at(words.south){\color{white}{\small\bfnew{特殊符号}}};
7
	\node[fill=blue!10,anchor=north,align=left,inner sep=3pt,minimum width=5em](eos)at(spe.south){$<$sos$>$\\[-0.5ex]$<$eos$>$};
8
		
单韦乔 committed
9
	\node[anchor=north,unit] (w1) at ([xshift=2.5em,yshift=-1em]eos.south){$w_1$};
10 11 12 13 14 15 16 17 18
	\node[anchor=north,unit,fill=red!10] (n11) at ([yshift=-0.5em]w1.south){$<$sos$>$};
		
\node [anchor=north west] (wtranslabel) at ([xshift=-5em,yshift=-3em]n11.south) {\small{生成顺序:}};
\draw [->,ultra thick,red,line width=1.5pt,opacity=0.7] (wtranslabel.east) -- ([xshift=1.5em]wtranslabel.east);

	\node[anchor=west,unit,fill=red!20] (n22) at ([xshift=3em]n11.east){agree};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt22) at (n22.east) {\small{{\color{white} \textbf{-0.4}}}};
	\node[anchor=south,unit,fill=red!20] (n21) at ([yshift=5.5em]n22.north){I};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt21) at (n21.east) {\small{{\color{white} \textbf{-0.5}}}};
19
	\node[anchor=north,unit,fill=blue!10] (n23) at ([yshift=-3em]n22.south){$<$eos$>$};
20
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt23) at (n23.east) {\small{{\color{white} \textbf{-2.2}}}};
单韦乔 committed
21
	\node[anchor=south,unit] (w2) at ([yshift=0.5em]n21.north){$w_2$};
22 23 24 25 26
		
	\node[anchor=west,unit,fill=red!20] (n32) at ([xshift=4em]n21.east){agree};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt32) at (n32.east) {\small{{\color{white} \textbf{-0.2}}}};
	\node[anchor=south,unit,fill=red!20] (n31) at ([yshift=0.3em]n32.north){I};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt31) at (n31.east) {\small{{\color{white} \textbf{-1.8}}}};
27
	\node[anchor=north,unit,fill=blue!10] (n33) at ([yshift=-0.3em]n32.south){$<$eos$>$};
28 29 30 31 32
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt33) at (n33.east) {\small{{\color{white} \textbf{-1.3}}}};
	\node[anchor=west,unit,fill=red!20] (n35) at ([xshift=4em]n22.east){agree};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt35) at (n35.east) {\small{{\color{white} \textbf{-1.5}}}};
	\node[anchor=south,unit,fill=red!20] (n34) at ([yshift=0.3em]n35.north){I};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt34) at (n34.east) {\small{{\color{white} \textbf{-2.0}}}};
33
	\node[anchor=north,unit,fill=blue!10] (n36) at ([yshift=-0.3em]n35.south){$<$eos$>$};
34
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt36) at (n36.east) {\small{{\color{white} \textbf{-1.3}}}};
单韦乔 committed
35
	\node[anchor=south,unit] (w3) at ([yshift=0.5em]n31.north){$w_3$};
36
		
37
	\node[anchor=west,unit,fill=blue!10] (n41) at ([xshift=4em]n31.east){$<$eos$>$};
38
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt41) at (n41.east) {\small{{\color{white} \textbf{-0.9}}}};
39
	\node[anchor=west,unit,fill=blue!10] (n42) at ([xshift=4em]n32.east){$<$eos$>$};
40
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt42) at (n42.east) {\small{{\color{white} \textbf{-0.8}}}};
41
	\node[anchor=west,unit,fill=blue!10] (n43) at ([xshift=4em]n34.east){$<$eos$>$};
42
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt43) at (n43.east) {\small{{\color{white} \textbf{-1.4}}}};
43
	\node[anchor=west,unit,fill=blue!10] (n44) at ([xshift=4em]n35.east){$<$eos$>$};
44
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt44) at (n44.east) {\small{{\color{white} \textbf{-0.1}}}};
单韦乔 committed
45
	\node[anchor=south,unit] (w4) at ([yshift=0.5em]n41.north){$w_4$};
46
		
47 48 49
	\draw[->,ublue,very thick,dotted] (n11.east) -- (n21.west);
%	\draw[->,ublue,very thick] (n11.east) -- (n22.west);
	\draw[->,ublue,very thick,dotted] (n11.east) -- (n23.west);
50
		
51 52 53 54 55 56
	\draw[->,ublue,very thick,dotted] (pt21.south) -- (n31.west);
	\draw[->,ublue,very thick,dotted] (pt21.south) -- (n32.west);
	\draw[->,ublue,very thick,dotted] (pt21.south) -- (n33.west);
	\draw[->,ublue,very thick,dotted] (pt22.south) -- (n34.west);
	\draw[->,ublue,very thick,dotted] (pt22.south) -- (n35.west);
%	\draw[->,ublue,very thick] (pt22.south) -- (n36.west);
57
		
58 59 60 61
	\draw[->,ublue,very thick,dotted] (pt31.south) -- (n41.west);
	\draw[->,ublue,very thick,dotted] (pt32.south) -- (n42.west);
	\draw[->,ublue,very thick,dotted] (pt34.south) -- (n43.west);
	\draw[->,ublue,very thick,dotted] (pt35.south) -- (n44.west);
62

63 64 65 66 67 68
%	\draw[->,red,ultra thick,opacity=0.7,line width=2pt]([xshift=-1em]n11.west) -- (n11.east) -- (n22.west) -- (pt22.south) -- (n36.west) -- ([xshift=1em]pt36.south);
	\draw[->,red,ultra thick,opacity=0.7,line width=2pt]([xshift=-1em]n11.west) -- (n11.west);
	\draw[->,red,ultra thick,opacity=0.7,line width=2pt](n11.east) -- (n22.west);	
	\draw[->,red,ultra thick,opacity=0.7,line width=2pt](pt22.south) -- (n36.west);
	\draw[->,red,ultra thick,opacity=0.7,line width=2pt](pt36.south) -- ([xshift=1em]pt36.south);

单韦乔 committed
69

70
\end{tikzpicture}