reorder-base-distance.tex 2.69 KB
Newer Older
曹润柘 committed
1 2 3 4 5 6 7 8
%%%------------------------------------------------------------------------------------------------------------
%%% 调序模型1:基于距离的调序
\begin{center}
\begin{tikzpicture}

\begin{scope}[minimum height = 20pt]

\node[anchor=east] (s0) at (-0.5em, 0) {$\textbf{s}$:};
9 10 11 12 13 14 15
\node[anchor=west,fill=green!20] (s1) at (0, 0) {\small{在 桌子 上 的}};
\node[anchor=south] (n1) at ([xshift=-3em,yshift=-0.5em]s1.north) {\small{1}};
\node[anchor=south] (n2) at ([xshift=-0.8em,yshift=-0.5em]s1.north) {\small{2}};
\node[anchor=south] (n3) at ([xshift=1.1em,yshift=-0.5em]s1.north) {\small{3}};
\node[anchor=south] (n4) at ([xshift=3em,yshift=-0.5em]s1.north) {\small{4}};
\node[anchor=west,fill=red!20] (s2) at ([xshift=1em]s1.east) {\small{苹果}};
\node[anchor=south] (n5) at ([yshift=-0.5em]s2.north) {\small{5}};
曹润柘 committed
16 17

\node[anchor=east] (t0) at (-0.5em, -1.5) {$\textbf{t}$:};
18 19
\node[anchor=west,fill=red!20] (t1) at (0, -1.5) {\small{the apple}};
\node[anchor=west,fill=green!20] (t2) at ([xshift=1em]t1.east) {\small{on the table}};
曹润柘 committed
20 21 22 23

\path[<->, thick] (s1.south) edge (t2.north);
\path[<->, thick] (s2.south) edge (t1.north);

24 25 26
\node[anchor=west] (target) at ([xshift=3.5em,yshift=2.3em]n5.east) {\small{目标短语}};
\node[anchor=west] (source) at ([xshift=0.5em]target.east) {\small{源短语}};
\node[anchor=west] (distance) at ([xshift=0.9em]source.east) {\small{距离}};
曹润柘 committed
27

28
\node[anchor=north] (t1) at ([xshift=0em,yshift=-0.1em]target.south) {1};
曹润柘 committed
29 30 31 32 33 34 35 36
\node[anchor=north] (t2) at ([yshift=-1.8em]t1.south) {2};

\node[anchor=north] (so1) at ([yshift=-0.1em]source.south) {5};
\node[anchor=north] (so2) at ([yshift=-1.8em]so1.south) {1-4};

\node[anchor=north] (d1) at ([xshift=-0.1em,yshift=-0.1em]distance.south) {+4};
\node[anchor=north] (d2) at ([yshift=-1.8em]d1.south) {-5};

37 38
\node[anchor=north west,fill=blue!20] (m1) at ([xshift=-1em,yshift=-0.0em]t1.south west) {\small{$\textrm{start}_1\ -\ \textrm{end}_{0}\ -\ 1$\ =\ 5\ -\ 0\ -\ 1}};
\node[anchor=north west,fill=blue!20] (m2) at ([xshift=-1em,yshift=-0.0em]t2.south west) {\small{$\textrm{start}_2\ -\ \textrm{end}_{1}\ -\ 1$\ =\ 1\ -\ 5\ -\ 1}};
曹润柘 committed
39

40
\draw[-] ([xshift=0.02in]target.south west)--([xshift=2in]target.south west);
曹润柘 committed
41 42 43 44 45 46 47

\draw[-,thick] (s1.north west)--([yshift=0.3in]s1.north west);
\draw[->,densely dotted,thick] ([yshift=0.3in]s1.north west)--([xshift=0.3in,yshift=0.3in]s1.north west);

\draw[-,thick] (s2.north west)--([yshift=0.3in]s2.north west);
\draw[->,densely dotted,thick] ([yshift=0.3in]s2.north west)--([xshift=-0.3in,yshift=0.3in]s2.north west);

曹润柘 committed
48 49
\node[anchor=south] (ld1) at ([xshift=-0.5em,yshift=0.4em]n1.north) {\small{$dr= -5$}};
\node[anchor=south] (ld2) at ([xshift=6.5em,yshift=0.4em]n1.north) {\small{$dr= +4$}};
曹润柘 committed
50 51 52 53

\end{scope}
\end{tikzpicture}
\end{center}