figure-translation-rule-describe-two-sentence-generation.tex 6.77 KB
Newer Older
曹润柘 committed
1 2 3 4 5 6 7 8 9
%------------------------------------------------------------------------------------------------------------
%%%  使用翻译规则
\begin{center}
\begin{tikzpicture}
\begin{scope}

{
% rule 1 (source)
\node [anchor=west] (rule1s1) at (0,0) {};
曹润柘 committed
10
\node [anchor=west,inner sep=2pt,fill=black] (rule1s2) at ([xshift=0.5em]rule1s1.east) {\scriptsize{{\color{white} $\funp{X}_1$}}};
曹润柘 committed
11
\node [anchor=west] (rule1s3) at ([xshift=0.5em]rule1s2.east) {};
曹润柘 committed
12
\node [anchor=west,inner sep=2pt,fill=black] (rule1s4) at ([xshift=0.5em]rule1s3.east) {\scriptsize{{\color{white} $\funp{X}_2$}}};
曹润柘 committed
13 14 15

% rule 1 (target)
\node [anchor=west] (rule1t1) at ([xshift=0.8in]rule1s4.east) {have};
曹润柘 committed
16
\node [anchor=west,inner sep=2pt,fill=black] (rule1t2) at ([xshift=0.5em]rule1t1.east) {\scriptsize{{\color{white} $\funp{X}_2$}}};
曹润柘 committed
17
\node [anchor=west] (rule1t3) at ([xshift=0.5em]rule1t2.east) {with};
曹润柘 committed
18
\node [anchor=west,inner sep=2pt,fill=black] (rule1t4) at ([xshift=0.5em]rule1t3.east) {\scriptsize{{\color{white} $\funp{X}_1$}}};
曹润柘 committed
19 20 21 22
}

{
% phrase 1 (source and target)
23 24
\node [anchor=north] (phrase1s1) at ([yshift=-1em]rule1s2.south) {\footnotesize{东软}};
\node [anchor=north] (phrase1t1) at ([yshift=-1em]rule1t4.south) {\footnotesize{Neusoft}};
曹润柘 committed
25 26 27 28
}

{
% phrase 2 (source and target)
29 30
\node [anchor=north] (phrase2s1) at ([yshift=-3em]rule1s4.south) {\footnotesize{合作}};
\node [anchor=north] (phrase2t1) at ([yshift=-3em]rule1t2.south) {\footnotesize{collaborative relations}};
曹润柘 committed
31 32 33 34
}

\begin{pgfonlayer}{background}
{
曹润柘 committed
35 36
\node [rectangle,draw=red,inner sep=1pt,thick,fill=white,drop shadow,rounded corners=0.3em] [fit = (rule1s1) (rule1s4)] (rule1s) {};
\node [rectangle,draw=red,inner sep=2pt,thick,fill=white,drop shadow,rounded corners=0.3em] [fit = (rule1t1) (rule1t4)] (rule1t) {};
曹润柘 committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50
\draw [<->,dotted,thick,red] ([xshift=0.1em]rule1s.east) -- ([xshift=-0.1em]rule1t.west);
}
\end{pgfonlayer}

{
% edges (phrases 1-2 to rule1)
\draw [->] (phrase1s1.north) -- ([yshift=-0.1em]rule1s2.south);
\draw [->] (phrase1t1.north) -- ([yshift=-0.1em]rule1t4.south);
\draw [->] (phrase2s1.north) -- ([yshift=-0.1em]rule1s4.south);
\draw [->] (phrase2t1.north) -- ([yshift=-0.1em]rule1t2.south);
}

{
% rule 2 (source)
曹润柘 committed
51
\node [anchor=west,inner sep=2pt,fill=black] (rule2s1) at ([yshift=3.5em,xshift=-0.5em]rule1s1.north west) {\scriptsize{{\color{white} $\funp{X}_1$}}};
曹润柘 committed
52
\node [anchor=west] (rule2s2) at ([xshift=0.5em]rule2s1.east) {};
曹润柘 committed
53
\node [anchor=west,inner sep=2pt,fill=black] (rule2s3) at ([xshift=0.5em]rule2s2.east) {\scriptsize{{\color{white} $\funp{X}_2$}}};
曹润柘 committed
54 55

% rule 2 (target)
曹润柘 committed
56
\node [anchor=west,inner sep=2pt,fill=black] (rule2t1) at ([xshift=1.8in]rule2s3.east) {\scriptsize{{\color{white} $\funp{X}_2$}}};
曹润柘 committed
57
\node [anchor=west] (rule2t2) at ([xshift=0.5em]rule2t1.east) {that};
曹润柘 committed
58
\node [anchor=west,inner sep=2pt,fill=black] (rule2t3) at ([xshift=0.5em]rule2t2.east) {\scriptsize{{\color{white} $\funp{X}_1$}}};
曹润柘 committed
59 60

% phrase 3 (source and target)
61 62
\node [anchor=north] (phrase3s1) at ([yshift=-0.8em]rule2s3.south) {\footnotesize{众多 高校}};
\node [anchor=north] (phrase3t1) at ([yshift=-0.8em]rule2t1.south) {\footnotesize{the many universities}};
曹润柘 committed
63 64 65 66 67 68 69 70 71 72

% edges (phrase 3 to rule 2 and rule1 to rule2)
\draw [->] (phrase3s1.north) -- ([yshift=-0.1em]rule2s3.south);
\draw [->] (phrase3t1.north) -- ([yshift=-0.1em]rule2t1.south);
\draw [->] ([xshift=2em]rule1s.north west) ..controls +(north:1.5em) and +(south:1.5em).. ([yshift=-0.1em]rule2s1.south);
\draw [->] ([xshift=-2em]rule1t.north east) ..controls +(north:1.5em) and +(south:1.5em).. ([yshift=-0.1em]rule2t3.south);
}

\begin{pgfonlayer}{background}
{
曹润柘 committed
73 74
\node [rectangle,draw=blue,inner sep=4pt,thick,fill=white,drop shadow,rounded corners=0.3em] [fit = (rule2s1) (rule2s3)] (rule2s) {};
\node [rectangle,draw=blue,inner sep=4pt,thick,fill=white,drop shadow,rounded corners=0.3em] [fit = (rule2t1) (rule2t3)] (rule2t) {};
曹润柘 committed
75 76 77 78 79 80
\draw [<->,dotted,thick,blue] ([xshift=0.1em]rule2s.east) -- ([xshift=-0.1em]rule2t.west);
}
\end{pgfonlayer}

{
% rule 3 (source)
曹润柘 committed
81
\node [anchor=west,inner sep=2pt,fill=black] (rule3s1) at ([yshift=2.5em,xshift=4em]rule2s1.north west) {\scriptsize{{\color{white} $\funp{X}_1$}}};
曹润柘 committed
82 83 84 85
\node [anchor=west] (rule3s2) at ([xshift=0.5em]rule3s1.east) {之一};

% rule 3 (target)
\node [anchor=west] (rule3t1) at ([xshift=1.0in]rule3s2.east) {one of};
曹润柘 committed
86
\node [anchor=west,inner sep=2pt,fill=black] (rule3t2) at ([xshift=0.5em]rule3t1.east) {\scriptsize{{\color{white} $\funp{X}_1$}}};
曹润柘 committed
87 88 89 90 91 92 93 94

% edges: rule 2 to rule 3
\draw [->] ([xshift=-1em]rule2s.north) ..controls +(north:1.2em) and +(south:1.2em).. ([yshift=-0.1em]rule3s1.south);
\draw [->] ([xshift=1em]rule2t.north) ..controls +(north:1.2em) and +(south:1.2em).. ([yshift=-0.1em]rule3t2.south);
}

\begin{pgfonlayer}{background}
{
曹润柘 committed
95 96
\node [rectangle,draw=ugreen,inner sep=1pt,thick,fill=white,drop shadow,rounded corners=0.3em] [fit = (rule3s1) (rule3s2)] (rule3s) {};
\node [rectangle,draw=ugreen,inner sep=2pt,thick,fill=white,drop shadow,rounded corners=0.3em] [fit = (rule3t1) (rule3t2)] (rule3t) {};
曹润柘 committed
97 98 99 100 101 102
\draw [<->,dotted,thick,ugreen] ([xshift=0.1em]rule3s.east) -- ([xshift=-0.1em]rule3t.west);
}
\end{pgfonlayer}

{
% rule 4 (source)
曹润柘 committed
103
\node [anchor=west,inner sep=2pt,fill=black] (rule4s1) at ([yshift=3.5em,xshift=-3.5em]rule3s1.north west) {\scriptsize{{\color{white} $\funp{X}_1$}}};
曹润柘 committed
104
\node [anchor=west] (rule4s2) at ([xshift=0.5em]rule4s1.east) {};
曹润柘 committed
105
\node [anchor=west,inner sep=2pt,fill=black] (rule4s3) at ([xshift=0.5em]rule4s2.east) {\scriptsize{{\color{white} $\funp{X}_2$}}};
曹润柘 committed
106 107

% rule 2 (target)
曹润柘 committed
108
\node [anchor=west,inner sep=2pt,fill=black] (rule4t1) at ([xshift=2.0in]rule4s2.east) {\scriptsize{{\color{white} $\funp{X}_1$}}};
曹润柘 committed
109
\node [anchor=west] (rule4t2) at ([xshift=0.5em]rule4t1.east) {is};
曹润柘 committed
110
\node [anchor=west,inner sep=2pt,fill=black] (rule4t3) at ([xshift=0.5em]rule4t2.east) {\scriptsize{{\color{white} $\funp{X}_2$}}};
曹润柘 committed
111 112

% phrase 4 (source and target)
113 114
\node [anchor=north] (phrase4s1) at ([yshift=-0.8em]rule4s1.south) {\footnotesize{东北大学}};
\node [anchor=north] (phrase4t1) at ([yshift=-0.8em]rule4t1.south) {\footnotesize{NEU}};
曹润柘 committed
115 116 117 118 119 120 121 122 123 124

% edges (phrase 4 to rule 4 and rule3 to rule4)
\draw [->] (phrase4s1.north) -- ([yshift=-0.1em]rule4s1.south);
\draw [->] (phrase4t1.north) -- ([yshift=-0.1em]rule4t1.south);
\draw [->] ([xshift=1em]rule3s.north) ..controls +(north:1.5em) and +(south:1.5em).. ([yshift=-0.1em]rule4s3.south);
\draw [->] ([xshift=-1em]rule3t.north east) ..controls +(north:1.5em) and +(south:1.5em).. ([yshift=-0.1em]rule4t3.south);
}

\begin{pgfonlayer}{background}
{
曹润柘 committed
125 126
\node [rectangle,draw=orange,inner sep=4pt,thick,fill=white,drop shadow,rounded corners=0.3em] [fit = (rule4s1) (rule4s3)] (rule4s) {};
\node [rectangle,draw=orange,inner sep=4pt,thick,fill=white,drop shadow,rounded corners=0.3em] [fit = (rule4t1) (rule4t3)] (rule4t) {};
曹润柘 committed
127 128 129 130 131 132 133
\draw [<->,dotted,thick,orange] ([xshift=0.1em]rule4s.east) -- ([xshift=-0.1em]rule4t.west);
}
\end{pgfonlayer}

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