TransWikia.com

Combinatory Categorial Grammar style

TeX - LaTeX Asked by Julián Sanabria on December 23, 2020

i was looking arround here for this style of Categorial Grammar (see picture). However, i just find another types of notation, like the Prawtiz’s style derivation. I want this style (some people call it Steedman sytle). If you can help with the package I must use and doing as example this derivation, i’ll appreciate it.

Getzen style

Thanks

3 Answers

I wrote a draft of CCG style manual. It only covers categorial grammar derivations but it may spare some time to potential users. The PDF is here

Answered by yannis on December 23, 2020

This can obviously use a bit of improvement in terms of fine tuning horizontal placement, but I mainly present it to highlight some new capability of tabstackengine 2018/03/05 (V2.10) uploaded this past Monday, with TABrules and TABcline{}.

documentclass{article}
usepackage[TABcline]{tabstackengine}
usepackage{xcolor}
deftbs{,textbackslash}
makeatletter
newcommandRR{%
  rlap{kern.5dimexprtabbed@gaprelaxllap{fboxsep=0ptcolorbox{white}{$>$}}}}
newcommandLL{%
  rlap{kern.5dimexprtabbed@gaprelaxllap{fboxsep=0ptcolorbox{white}{$<$}}}}
makeatother
setlengthTABruleshift{dimexpr.5htstrutbox-.5dpstrutbox}
setstacktabbedgap{1ex}
TABstackTextstyle{itshape}
setstackgap{S}{2pt}
begin{document}
bgroup
catcode`!=active def!{upshape}
catcode`?=active def?#1{makebox[0pt]{#1}}
tabbedShortstack{
!Female &        &!astronaut &  & !sets        &        & !new   &        & !record   &
TABcline{1,3,5,7,9}
N/N     &        & N         &  &{!(}Stbs NP/{!)}/NP& & N/N    &        & N         &
TABrule&TABrule&TABruleRR&  &              &        &TABrule&TABrule&TABruleRR&
        &?N      &           &  &              &        &        &?N      &           &
TABcline{1-3,7-9}
        &?{NP}   &           &  &              &        &        &?{NP}   &           &
        &        &           &  &TABrule      &TABrule&TABrule&TABrule&TABruleRR&
        &        &           &  &              &?{Stbs NP}&     &        &           &
TABrule&TABrule&TABrule   &TABrule&TABrule&TABrule&TABrule&TABruleLL&        &
        &        &           &?S&              &        &        &        &           &
}
egroup
end{document}

enter image description here

Answered by Steven B. Segletes on December 23, 2020

I was recently in need of this style of notation as well. To make it easier for others to get started using it, I am just combining the comment of Alan Munn and the answer by yannis.

Indeed the best way to produce derivations of the Steedman style is to use the .sty files provided by github.com/jasonbaldridge/cg-latex. Simply copy them into your working directory, and then use this MWE:

documentclass{article}
usepackage{ccg}
usepackage{amstext}

begin{document}

deriv{5} {
    text{Female}   & text{astronaut}   & text{sets}          & text{new}  & text{record}   
    uline{1}       & uline{1}          & uline{1}            & uline{1}   & uline{1}       
    text{N/N}      & text{N}           & text{(Sbs NP)/NP}  & text{N/N}  & text{N}        
                fapply{2}               &                      &         fapply{2}            
            mc{2}{text{N}}             &                      &      mc{2}{text{N}}         
                uline{2}                &                      &         uline{2}             
            mc{2}{text{NP}}            &                      &      mc{2}{text{NP}}        
                    &                    &                      fapply{3}                      
                    &                    &                   mc{3}{text{Sbs NP}}             
                                    bapply{4}                                &                 
                                 mc{4}{text{S}}                             &                 
}

end{document}

Which produces: Combinatory Categorial Grammar example

For the documentation you can refer to the Readme in the repository or, much easier, the manual by yannis which has since moved to here.

Answered by dashdeckers on December 23, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP