210 lines
5.9 KiB
TeX
210 lines
5.9 KiB
TeX
|
\documentclass[a4paper]{report}
|
||
|
|
||
|
\usepackage[T1]{fontenc}
|
||
|
\usepackage[utf8]{inputenc}
|
||
|
|
||
|
\title{DGP}
|
||
|
\author{Tomasz Obrębski}
|
||
|
|
||
|
|
||
|
\begin{document}
|
||
|
\maketitle
|
||
|
|
||
|
\chapter{Introduction}
|
||
|
|
||
|
\chapter{Grammar}
|
||
|
|
||
|
\chapter{Parsing algorithm}
|
||
|
|
||
|
\chapter{Input}
|
||
|
|
||
|
Wejście dla parsera przygotowuje się w następujący sposób:
|
||
|
\begin{verbatim}
|
||
|
cat text.txt | tok | sen | lem | canonize | gph | dgp ...
|
||
|
\end{verbatim}
|
||
|
|
||
|
Plik wejściowy
|
||
|
|
||
|
dgp bierze na wejściu graf słów (wordgraph). Numery wierzchołków tego
|
||
|
grafu to wartości pola gph. Pole to jest wprowadzane do pliku przez
|
||
|
program gph.
|
||
|
|
||
|
Poza polem gph, dgp odczytuje też wartość pola lem.
|
||
|
|
||
|
\chapter{Output}
|
||
|
|
||
|
Format:
|
||
|
|
||
|
0005 04 W goni lem:gonić,V/AiMdNsP3TfrVp gph:4:1,2,3 dgp:6;s
|
||
|
|
||
|
\begin{verbatim}
|
||
|
|
||
|
dgp:<node>;<saturation>[;<links>][;<sets>][;<constraints>]
|
||
|
|
||
|
\end{verbatim}
|
||
|
|
||
|
\begin{description}
|
||
|
\item[{\it node}] Dependency graph node number.
|
||
|
\item[saturation] The information whether the node is saturated. A
|
||
|
node is saturated if the list of required connections for this node
|
||
|
is empty, it is unsaturated otherwise.
|
||
|
\item[links] The comma separated list of connections. For each node
|
||
|
either the list of its dependents or the list of its heads may be
|
||
|
printed, or both (this dependes on the value of the \verb|--info|
|
||
|
parameter).
|
||
|
\item[sets] For each node, the sets of all its left neighbours,
|
||
|
transitive left heads, transitive left dependents, and nodes visible
|
||
|
on the left can be printed. (This information is useful for fast
|
||
|
tree generation.)
|
||
|
\item[constraints] the information on constraints imposed on the
|
||
|
node. Constraints follow from the SGL and REQ grammar rules and have
|
||
|
the form of a comma-separated list of dependency types required by
|
||
|
the node and forbidden for the node. The elements of the list have
|
||
|
the following format:
|
||
|
|
||
|
\begin{tabular}{ll}
|
||
|
|
||
|
\verb|!|{\it dependency type} & {\it dependency type} is required\\
|
||
|
\verb|&|{\it dependency type} & {\it dependency type} is forbidden
|
||
|
|
||
|
\end{tabular}
|
||
|
|
||
|
\end{description}
|
||
|
|
||
|
|
||
|
Wynikiem pracy dgp jest graf zależności. Graf ten może zawierać
|
||
|
(zwykle tak jest) więcej wierzchołków niż graf wejściowy.
|
||
|
|
||
|
* numer wierzchołka w wyjściowym grafie zależności
|
||
|
|
||
|
Numery wierzchołków w wyjściowym grafie są inne. Podczas działania
|
||
|
parser tworzy kopie (klony) wierzchołków wejściowych. Dzieje się tak w
|
||
|
sytuacji, kiedy do wierzchołka (jako nadrzędnika) dowiazywana jest
|
||
|
zależnośc objęta ograniczeniami. Ograniczenia wynikają z reguł
|
||
|
gramatyki SGL i OBL.
|
||
|
|
||
|
SGL - zależność jednokrotna
|
||
|
OBL - zależność obligatiryjna
|
||
|
|
||
|
node saturation \verb|s| or \verb|u|
|
||
|
|
||
|
s - wierzchołek nasycony
|
||
|
u - wierzchołek nienasycony
|
||
|
|
||
|
Wierzchołek nienasycony to taki, któremu brakuje obowiązkowy podrzędnik.
|
||
|
Obowiązkowe podrzędniki określane są w regułach OBL gramatyki.
|
||
|
|
||
|
connections
|
||
|
* connection list
|
||
|
connections are lista zależności zawiera oddzielony przecinkami ciąg wyrażeń
|
||
|
|
||
|
--<typ>-<w1>/<w2>
|
||
|
|
||
|
jeśli w wywołaniu programu dla parametru --info podano wśród wartości 'd'
|
||
|
(od dependents)
|
||
|
|
||
|
lub
|
||
|
|
||
|
++<typ>-<w1>/<w2>
|
||
|
|
||
|
jeśli w wywołaniu programu dla parametru --info podano wśród wartości 'h'
|
||
|
|
||
|
|
||
|
Może też zawierac oba typy wyrażeń, jeśli podano zarówno 'd' jak i 'h'.
|
||
|
|
||
|
Wyrażenie
|
||
|
|
||
|
--<typ>-<w1>/<w2>
|
||
|
|
||
|
oznacza możliwość istnienia zależności typu <typ>, której nadrzędnikiem jest aktualny wierzchołek, a podrzędnikiem
|
||
|
wierzchołek <w1> (o <w2> za chwilę).
|
||
|
|
||
|
|
||
|
pies goni czarnego kota w butach.
|
||
|
|
||
|
\begin{figure}
|
||
|
\begin{verbatim}
|
||
|
0000 00 BOS *
|
||
|
0000 04 W Pies lem:pies,N/CnGaNs
|
||
|
0004 01 S _
|
||
|
0005 04 W goni lem:gonić,V/AiMdNsP3TfrVp
|
||
|
0009 01 S _
|
||
|
0010 08 W czarnego lem:czarny,ADJ/CaDpGapNs
|
||
|
0010 08 W czarnego lem:czarny,ADJ/CgDpGainpNs
|
||
|
0018 01 S _
|
||
|
0019 04 W kota lem:kota,N/CnGfNs
|
||
|
0019 04 W kota lem:kot,N/CaGaNs
|
||
|
0019 04 W kota lem:kot,N/CgGaNs
|
||
|
0023 01 S _
|
||
|
0024 01 W w lem:w,P/Cal
|
||
|
0025 01 S _
|
||
|
0026 06 W butach lem:buta,N/ClGfNp
|
||
|
0026 06 W butach lem:but,N/ClGiNp
|
||
|
0032 01 P .
|
||
|
0033 01 S \n
|
||
|
0034 00 EOS *
|
||
|
\end{verbatim}
|
||
|
\caption{output of \verb@tok | sen | lem | canonize@}
|
||
|
\end{figure}
|
||
|
|
||
|
|
||
|
\begin{figure}
|
||
|
\scriptsize
|
||
|
\begin{verbatim}
|
||
|
0000 00 BOS * gph:0:
|
||
|
0000 04 W Pies lem:pies,N/CnGaNs gph:1:0
|
||
|
0004 01 S _
|
||
|
0005 04 W goni lem:gonić,V/AiMdNsP3TfrVp gph:2:1
|
||
|
0009 01 S _
|
||
|
0010 08 W czarnego lem:czarny,ADJ/CaDpGapNs gph:3:2
|
||
|
0010 08 W czarnego lem:czarny,ADJ/CgDpGainpNs gph:4:2
|
||
|
0018 01 S _
|
||
|
0019 04 W kota lem:kota,N/CnGfNs gph:5:3,4
|
||
|
0019 04 W kota lem:kot,N/CaGaNs gph:6:3,4
|
||
|
0019 04 W kota lem:kot,N/CgGaNs gph:7:3,4
|
||
|
0023 01 S _
|
||
|
0024 01 W w lem:w,P/Cal gph:8:5,6,7
|
||
|
0025 01 S _
|
||
|
0026 06 W butach lem:buta,N/ClGfNp gph:9:8
|
||
|
0026 06 W butach lem:but,N/ClGiNp gph:10:8
|
||
|
0032 01 P .
|
||
|
0033 01 S \n
|
||
|
0034 00 EOS * gph:11:9,10
|
||
|
\end{verbatim}
|
||
|
\caption{Word graph representation: sentence annotated with gph.}
|
||
|
\end{figure}
|
||
|
|
||
|
|
||
|
\begin{figure}
|
||
|
\scriptsize
|
||
|
\begin{verbatim}
|
||
|
0000 00 BOS * gph:0: dgp:0;s;;
|
||
|
0000 04 W Pies lem:pies,N/CnGaNs gph:1:0 dgp:1;s;;
|
||
|
0004 01 S _
|
||
|
0005 04 W goni lem:gonić,V/AiMdNsP3TfrVp gph:2:1 dgp:2;s;;
|
||
|
0005 04 W goni lem:gonić,V/AiMdNsP3TfrVp gph:2:1 dgp:3;s;--subj-1/2;!subj
|
||
|
0005 04 W goni lem:gonić,V/AiMdNsP3TfrVp gph:2:1 dgp:8;s;--cmpl_ga-7/3,--cmpl_ga-10/3,--prep-11/8;!subj!cmpl_ga
|
||
|
0005 04 W goni lem:gonić,V/AiMdNsP3TfrVp gph:2:1 dgp:9;s;--cmpl_ga-7/2,--cmpl_ga-10/2,--prep-11/9;!cmpl_ga
|
||
|
0009 01 S _
|
||
|
0010 08 W czarnego lem:czarny,ADJ/CaDpGapNs gph:3:2 dgp:4;s;;
|
||
|
0010 08 W czarnego lem:czarny,ADJ/CgDpGainpNs gph:4:2 dgp:5;s;;
|
||
|
0018 01 S _
|
||
|
0019 04 W kota lem:kota,N/CnGfNs gph:5:3,4 dgp:6;s;--prep-11/6;
|
||
|
0019 04 W kota lem:kot,N/CaGaNs gph:6:3,4 dgp:7;s;--mod-4/7,--prep-11/7;
|
||
|
0019 04 W kota lem:kot,N/CgGaNs gph:7:3,4 dgp:10;s;--mod-5/10,--prep-11/10;
|
||
|
0023 01 S _
|
||
|
0024 01 W w lem:w,P/Cal gph:8:5,6,7 dgp:11;u;;&pcmpl
|
||
|
0024 01 W w lem:w,P/Cal gph:8:5,6,7 dgp:13;s;--pcmpl-12/11,--pcmpl-14/11;!pcmpl
|
||
|
0025 01 S _
|
||
|
0026 06 W butach lem:buta,N/ClGfNp gph:9:8 dgp:12;s;;
|
||
|
0026 06 W butach lem:but,N/ClGiNp gph:10:8 dgp:14;s;;
|
||
|
0032 01 P .
|
||
|
0033 01 S \n
|
||
|
0034 00 EOS * gph:11:9,10 dgp:15;s;;
|
||
|
\end{verbatim}
|
||
|
\caption{dgp output}
|
||
|
\end{figure}
|
||
|
|
||
|
|
||
|
\end{document}
|