translation-rule-based-on-admissible-node.tex 3.88 KB
Newer Older
曹润柘 committed
1 2 3 4 5
%%%------------------------------------------------------------------------------------------------------------
%%%  规则抽取
\begin{center}
\begin{tikzpicture}

6
{\small
曹润柘 committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
\begin{scope}[sibling distance=25pt, level distance=20pt]

\Tree[.\node(n1){IP};
     	[.\node(n2){NP}; [.\node(n3){PN}; \node(cw1){}; ]]
     	[.\node(n4){VP};
     		[.\node(n5){PP};
     			[.\node(n6){P}; \node(cw2){}; ]
     			[.\node(n7){NP};
                    [.\node(n8){NN}; \node(cw3){回答}; ]
                ]
     		]
     		[.\node(n9){VP};
     			[.\node(n10){VV}; \node(cw4){表示}; ]
     			[.\node(n11){NN}; \node(cw5){满意}; ]
     		]
     	]
     ]

25 26 27 28 29 30 31 32
\node[anchor=north,minimum size=18pt,align=center] (tw1) at ([yshift=-6.0em]cw1.south){he\\\footnotesize{1}};
\node[anchor=west,minimum size=18pt,align=center] (tw2) at ([yshift=-0.1em,xshift=1.1em]tw1.east){was\\\footnotesize{2}};
\node[anchor=west,minimum size=18pt,align=center] (tw3) at ([yshift=0.1em,xshift=1.1em]tw2.east){satisfied\\\footnotesize{3}};
\node[anchor=west,minimum size=18pt,align=center] (tw4) at ([xshift=1.1em]tw3.east){with\\\footnotesize{4}};
\node[anchor=west,minimum size=18pt,align=center] (tw5) at ([xshift=1.1em]tw4.east){the\\\footnotesize{5}};
\node[anchor=west,minimum size=18pt,align=center] (tw6) at ([yshift=-0.1em,xshift=1.1em]tw5.east){answer\\\footnotesize{6}};

\node[anchor=north,minimum size=18pt,align=center] (empty) at ([xshift=-2.0em]cw1.south){};
曹润柘 committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63

\draw[dashed] (cw1.south) -- ([yshift=-0.4em]tw1.north);
\draw[dashed] (cw2.south) .. controls +(south:1.6) and +(north:0.6) .. ([yshift=-0.4em]tw4.north);
\draw[dashed] (cw3.south) -- ([yshift=-0.4em]tw5.north);
\draw[dashed] (cw3.south) -- ([yshift=-0.4em]tw6.north);
\draw[dashed] (cw4.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);
\draw[dashed] (cw5.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);

\begin{pgfonlayer}{background}
{
\node [fill=blue!30] [fit = (cw2) (cw3) (n7) (n8)] (rule1box1) {};
\node [fill=blue!30] [fit = (n4) (n9)] (rule1box2) {};
\node [fill=blue!30] [fit = (tw3) (tw4) (tw5) (tw6)] (rule1box3) {};
\path [fill=blue!30] ([xshift=0.05em]rule1box2.north west) -- ([xshift=-0.3em,yshift=0.3em]n5.north west) -- ([yshift=-0.05em]rule1box1.north west) -- ([xshift=0.05em,yshift=-0.05em]rule1box2.south west) -- ([xshift=0.05em]rule1box2.north west);
}

\node [rectangle,fill=orange!20,inner sep=0] [fit = (n11)] (n11box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n4)] (n4box) {};

\node [rectangle,fill=green!20,inner sep=0] [fit = (n1)] (n1box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n2)] (n2box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n3)] (n3box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n5)] (n5box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n6)] (n6box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n7)] (n7box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n8)] (n8box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n9)] (n9box) {};
\node [rectangle,fill=orange!20,inner sep=0] [fit = (n10)] (n10box) {};
\end{pgfonlayer}

\node [anchor=north west, minimum size=1.2em, fill=green!20] (land1) at ([xshift=1.5em,yshift=-1em]cw5.south east) {};
64
\node [anchor=west] (land1label) at (land1.east) {\footnotesize{可信}};
曹润柘 committed
65
\node [anchor=north west, minimum size=1.2em, fill=orange!20] (land2) at ([yshift=-0.3em]land1.south west) {};
66
\node [anchor=west] (land2label) at (land2.east) {\footnotesize{不可信}};
曹润柘 committed
67 68 69 70

{
\node [draw,thick,red,fill=red!20] [fit = (n9)] (var1) {{\color{black} VP}};
\node [draw,thick,red,fill=red!20] [fit = (tw3)] (var1v2) {{\color{black} \large{VP}}};
71 72
\node [anchor=west] (var1label) at ([yshift=0.5em]var1.east) {\footnotesize{\red{变量}}};
\node [anchor=south] (var1v2label) at ([xshift=-2em]var1v2.north) {\footnotesize{\red{变量}}};
曹润柘 committed
73 74 75 76 77 78 79
}

\end{scope}
}

\end{tikzpicture}
\end{center}