forked from bozsahin/ccg-latex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.tex
102 lines (89 loc) · 4.01 KB
/
example.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
\documentclass[11pt]{article}
% Use of CCG latex commands --cem bozsahin 2017
\usepackage{mathptmx} % this font is for demo. CM fonts look ugly.
\usepackage{ccg-latex}
\begin{document}
{\large\bf Using the \verb|ccg-latex.sty| file}\hfill{\small Cem Boz\c{s}ahin}\hfill\today\vfill
Examples with the \verb|\cgex{n}{derivations}| command:\vfill
\cgex{3}{John & likes & Mary\\
\cglines{3}\\
\cgf{S\fs(S\bs NP)} & \cgf{(S\bs\cgs{NP}{3s})\fs NP} & \cgf{(S\bs NP)\bs((S\bs NP)\fs NP)}\\
\lf{\lambda p.p\,\so{john}} & \lf{\lambda x\lambda y.\so{like}xy} & \lf{\lambda p.p\,\so{mary}}\\
&\cgline{2}{\cgba}\\
&\cgres{2}{S\bs NP \lf{\lambda y.\so{like}\so{mary}y}}\\ % note that \cgres is by default in \cgf font
\cgline{3}{\cgfa}\\
\cgres{3}{S \lf{\so{like}\so{mary}\so{john}}}
}\vfill
\cgex{3}{John & likes & Mary\\ % uses the alias \cat rather than \cgf above--same result
\cgul & \cgul & \cgul\\ % manually repeats the columns for comparison with \cglines above
\cat{S\fs(S\bs NP)} & \cat{(S\bs\cgs{NP}{3s})\fs NP} & \cat{S\bs(S\fs NP)}\\
\lf{\lambda p.p\,\so{john}} & \lf{\lambda x\lambda y.\so{like}xy} & \lf{\lambda p.p\,\so{mary}}\\
\cgline{2}{\cgfc}\\
\cgres{2}{S\fs NP \lf{\lambda x.\so{like}x\so{john}}}\\ % note that \cgres is by default in \cgf font
\cgline{3}{\cgfa}\\
\cgres{3}{\cat{S} \lf{\so{like}\so{mary}\so{john}}} % using \cat inside \cgres is nae problem
}\vfill
\cgex{3}{dismiss& -ed\\
\cglines{2}\\
\cgf{\cgs{VP}{inf}\fs\cgs{NP}{}$:\lambda x\lambda y.\so{dismiss}\,x\,y$}&
\cgf{((\cgs{S}{}\bs\cgs{NP}{agr})\fs NP)\bss(\cgs{VP}{inf}\fs NP)$:\lambda p\lambda x\lambda y.\so{past}(P\,xy)$}\\
\cgline{2}{\cgba}\\
\cgres{2}{\cgf{(\cgs{S}{}\bs\cgs{NP}{agr})\fs\cgs{NP}{}$:\lambda x\lambda y.\so{past}(\so{dismiss}\,x\,y)$}}
}\vfill
{\footnotesize
Mary \cgex{6}{musn't & have & been & being & arrest & -ed\\
\cglines{6}\\
\cgf{(\cgs{S}{pres}\bs NP)\fs\cgs{VP}{1sg-pl}}
& \cgf{\cgs{VP}{1sg-pl}\fs\cgs{VP}{en}}
&\cgf{\cgs{VP}{en,ing}\fs\cgs{VP}{ing}}
&\cgf{\cgs{VP}{pass,ing}\fs\cgs{VP}{pass}}
&\cgf{\cgs{VP}{inf}\fds NP}
&\cgf{\cgs{VP}{pass}\lds(\cgs{VP}{inf}\fs NP)}\\
\cgline{2}{\cgfc} &&&\cgline{2}{\cgba}\\
\cgres{2}{(\cgs{S}{pres}\bs NP)\fs\cgs{VP}{en}} &&&\cgres{2}{\cgs{VP}{pass}}\\
\cgline{3}{\cgfc}\\
\cgres{3}{(\cgs{S}{pres}\bs NP)\fs\cgs{VP}{ing}}\\
\cgline{4}{\cgfc}\\
\cgres{4}{(\cgs{S}{pres}\bs NP)\fs\cgs{VP}{pass}}\\
\cgline{6}{\cgfa}\\
\cgres{6}{\cgs{S}{pres}\bs NP}
}}\vfill
\newpage
\noindent Example above using \verb|\begin{ccg}{n}{data}{derivations}\end{ccg}|.
This environment puts in the first lines itself. Based on \verb|\cgex|.
No gloss line on top.\vfill
{\footnotesize
Mary
\begin{ccg}{6}{musn't & have & been & being & arrest & -ed}
{\cgf{(\cgs{S}{pres}\bs NP)\fs\cgs{VP}{1sg-pl}}
& \cgf{\cgs{VP}{1sg-pl}\fs\cgs{VP}{en}}
&\cgf{\cgs{VP}{en,ing}\fs\cgs{VP}{ing}}
&\cgf{\cgs{VP}{pass,ing}\fs\cgs{VP}{pass}}
&\cgf{\cgs{VP}{inf}\fds NP}
&\cgf{\cgs{VP}{pass}\lds(\cgs{VP}{inf}\fs NP)}\\
\cgline{2}{\cgfc} &&&\cgline{2}{\cgba}\\
\cgres{2}{(\cgs{S}{pres}\bs NP)\fs\cgs{VP}{en}} &&&\cgres{2}{\cgs{VP}{pass}}\\
\cgline{3}{\cgfc}\\
\cgres{3}{(\cgs{S}{pres}\bs NP)\fs\cgs{VP}{ing}}\\
\cgline{4}{\cgfc}\\
\cgres{4}{(\cgs{S}{pres}\bs NP)\fs\cgs{VP}{pass}}\\
\cgline{6}{\cgfa}\\
\cgres{6}{\cgs{S}{pres}\bs NP}
}
\end{ccg}
}\vfill
\noindent Another example, to show glossing in the beginning and the end.
It uses
\verb|\begin{ccgg}{n}{data}{gloss}{derivations}\end{ccgg}|.
\vfill
\begin{ccgg}{3}{ver-dir & -t & -ti.}{give{-caus} & {-caus} & {-past}}
{
\cgf{\cgs{VP}{inf}\bs\cgs{NP}{dat}\bs\cgs{NP}{dat}\bs\cgs{NP}{acc}}
& \cgf{(S\bs\cgs{NP}{nom}\bs\cgs{NP}{case})\bs\cgs{VP}{inf}}\\
\lf{\lambda x\lambda y\lambda z.\so{give}yxz} & \lf{\lambda p\lambda x\lambda y.\so{cause}(px)y}\\
\cgline{2}{\cgbc$^3$}\\ \cgres{2}{S\bs\cgs{NP}{nom}\bs\cgs{NP}{dat}\bs\cgs{NP}{dat}\bs\cgs{NP}{dat}\bs\cgs{NP}{acc}}\\
\cgres{2}{\lf{\lambda x_1\lambda x_2\lambda x_3\lambda x_4\lambda x_5.\so{cause}(\so{cause}(\so{give}x_1x_2x_3)x_4)x_5}}\\[1ex]
\mc{3}{`made to let give', from Turkish}
}
\end{ccgg}\vfill
\end{document}