diff --git a/lib/doc/MkExxTable.hs b/lib/doc/MkExxTable.hs index b19fea455..bcc874ac5 100644 --- a/lib/doc/MkExxTable.hs +++ b/lib/doc/MkExxTable.hs @@ -22,7 +22,7 @@ readApiExxOne file = do s <- readFile file let lang = reverse (take 3 (drop 4 (reverse file))) -- api-exx-*Eng*.txt let api = getApiExxOne $ filter validOutput $ lines s - putStrLn $ unlines $ prApiEx api + putStrLn $ unlines $ prApiEx api --- return (lang,api) -- map function -> language -> example @@ -68,9 +68,12 @@ prApiExx aexx = unlines prApiEx :: M.Map String String -> [String] prApiEx apexx = case M.toList apexx of (a,e):lexx -> (a ++ ": ``" ++ unwords (words e) ++ "``"): - [l ++ ": //" ++ doBind e ++ "//" | (l,e) <- lexx] + [l ++ ": //" ++ mkEx e ++ "//" | (l,e) <- lexx] -doBind = unwords . bind . words +mkEx e = case words e of + "atomic":"term":_ -> "*" + "[]":_ -> "''" + es -> unwords (bind es) bind ws = case ws of w : "&+" : u : ws2 -> bind ((w ++ u) : ws2) diff --git a/lib/doc/api-examples.txt b/lib/doc/api-examples.txt index 161f586cb..4d615753d 100644 --- a/lib/doc/api-examples.txt +++ b/lib/doc/api-examples.txt @@ -173,7 +173,7 @@ mkUtt (mkVP paint_V2A it_NP (mkAP red_A)) mkVP : V2S -> NP -> S -> VP -- answer to him that we sleep mkUtt (mkVP answer_V2S he_NP (mkS (mkCl she_NP sleep_V))) mkVP : V2Q -> NP -> QS -> VP -- ask him who sleeps -mkUtt (mkVP answer_V2S he_NP (mkQS (mkQCl who_IP sleep_V))) +mkUtt (mkVP ask_V2Q he_NP (mkQS (mkQCl who_IP sleep_V))) mkVP : V2V -> NP -> VP -> VP -- beg him to sleep mkUtt (mkVP beg_V2V he_NP (mkVP sleep_V)) mkVP : A -> VP -- be old @@ -592,65 +592,65 @@ mkIP (mkIDet which_IQuant pluralNum) house_N mkIDet : IQuant -> IDet mkIP (mkIDet which_IQuant) house_N which_IDet : IDet -mkIP which_IDet +mkIP which_IDet house_N whichPl_IDet : IDet -mkIP whichPl_IDet +mkIP whichPl_IDet house_N mkRS : (Tense) -> (Ant) -> (Pol) -> RCl -> RS -- that wouldn't have slept -mkRS conditionalTense anteriorAnt negativePol (mkRCl which_RP sleep_V) +mkCN woman_N (mkRS conditionalTense anteriorAnt negativePol (mkRCl which_RP sleep_V)) mkRS : RCl -> RS -- -mkRS (mkRCl which_RP sleep_V) +mkCN woman_N (mkRS (mkRCl which_RP sleep_V)) mkRS : Conj -> RS -> RS -> RS -- -mkRS or_Conj (mkRS (mkRCl which_RP sleep_V)) (mkRS (mkRCl which_RP she_NP love_V2)) +mkCN woman_N (mkRS or_Conj (mkRS (mkRCl which_RP sleep_V)) (mkRS (mkRCl which_RP we_NP love_V2))) mkRCl : RP -> VP -> RCl -- who sleeps -mkRCl which_RP (mkVP (mkVP sleep_V) here_Adv) +mkCN woman_N (mkRS (mkRCl which_RP (mkVP (mkVP sleep_V) here_Adv))) mkRCl : RP -> V -> RCl -- who sleeps -mkRCl which_RP sleep_V +mkCN woman_N (mkRS (mkRCl which_RP sleep_V)) mkRCl : RP -> V2 -> NP -> RCl -- who loves her -mkRCl which_RP love_V2 she_NP +mkCN woman_N (mkRS (mkRCl which_RP love_V2 he_NP)) mkRCl : RP -> V3 -> NP -> NP -> RCl -- who sends it to her -mkRCl which_RP send_V3 it_NP she_NP +mkCN woman_N (mkRS (mkRCl which_RP send_V3 it_NP he_NP)) mkRCl : RP -> VV -> VP -> RCl -- who wants to sleep -mkRCl which_RP want_VV (mkVP sleep_V) +mkCN woman_N (mkRS (mkRCl which_RP want_VV (mkVP sleep_V))) mkRCl : RP -> VS -> S -> RCl -- who says that I sleep -mkRCl which_RP say_VS (mkS (mkCl i_NP sleep_V)) +mkCN woman_N (mkRS (mkRCl which_RP say_VS (mkS (mkCl i_NP sleep_V)))) mkRCl : RP -> VQ -> QS -> RCl -- who wonders who sleeps -mkRCl which_RP wonder_VQ (mkQS (mkQCl who_IP sleep_V)) +mkCN woman_N (mkRS (mkRCl which_RP wonder_VQ (mkQS (mkQCl who_IP sleep_V)))) mkRCl : RP -> VA -> A -> RCl -- who becomes old -mkRCl which_RP become_VA old_A +mkCN woman_N (mkRS (mkRCl which_RP become_VA old_A)) mkRCl : RP -> VA -> AP -> RCl -- who becomes very old -mkRCl which_RP become_VA (mkAP very_AdA old_A) +mkCN woman_N (mkRS (mkRCl which_RP become_VA (mkAP very_AdA old_A))) mkRCl : RP -> V2A -> NP -> A -> RCl -- who paints it red -mkRCl which_RP paint_V2A it_NP red_A +mkCN woman_N (mkRS (mkRCl which_RP paint_V2A it_NP red_A)) mkRCl : RP -> V2A -> NP -> AP -> RCl -- who paints it very red -mkRCl which_RP paint_V2A it_NP (mkAP red_A) +mkCN woman_N (mkRS (mkRCl which_RP paint_V2A it_NP (mkAP very_AdA red_A))) mkRCl : RP -> V2S -> NP -> S -> RCl -- who answers to him that we sleep -mkRCl which_RP answer_V2S he_NP (mkS (mkCl we_NP sleep_V)) +mkCN woman_N (mkRS (mkRCl which_RP answer_V2S he_NP (mkS (mkCl we_NP sleep_V)))) mkRCl : RP -> V2Q -> NP -> QS -> RCl -- who asks him who sleeps -mkRCl which_RP ask_V2Q he_NP (mkQS (mkQCl who_IP sleep_V)) +mkCN woman_N (mkRS (mkRCl which_RP ask_V2Q he_NP (mkQS (mkQCl who_IP sleep_V)))) mkRCl : RP -> V2V -> NP -> VP -> RCl -- who begs him to sleep -mkRCl which_RP beg_V2V he_NP (mkVP sleep_V) +mkCN woman_N (mkRS (mkRCl which_RP beg_V2V he_NP (mkVP sleep_V))) mkRCl : RP -> A -> RCl -- who is old -mkRCl which_RP old_A +mkCN woman_N (mkRS (mkRCl which_RP old_A)) mkRCl : RP -> A -> NP -> RCl -- who is older than he -mkRCl which_RP old_A he_NP +mkCN woman_N (mkRS (mkRCl which_RP old_A he_NP)) mkRCl : RP -> A2 -> NP -> RCl -- who is married to him -mkRCl which_RP married_A2 he_NP +mkCN woman_N (mkRS (mkRCl which_RP married_A2 he_NP)) mkRCl : RP -> AP -> RCl -- who is very old -mkRCl which_RP (mkAP very_AdA old_A) +mkCN woman_N (mkRS (mkRCl which_RP (mkAP very_AdA old_A))) mkRCl : RP -> NP -> RCl -- who is the woman -mkRCl which_RP (mkNP the_Det woman_N) +mkCN woman_N (mkRS (mkRCl which_RP (mkNP the_Det woman_N))) mkRCl : RP -> N -> RCl -- who is a woman -mkRCl which_RP woman_N +mkCN student_N (mkRS (mkRCl which_RP woman_N)) mkRCl : RP -> CN -> RCl -- who is an old woman -mkRCl which_RP (mkCN old_A woman_N) +mkCN student_N (mkRS (mkRCl which_RP (mkCN old_A woman_N))) mkRCl : RP -> Adv -> RCl -- who is here -mkRCl which_RP here_Adv +mkCN woman_N (mkRS (mkRCl which_RP here_Adv)) mkRCl : RP -> VP -> RCl -- who always sleeps -mkRCl which_RP (mkVP always_AdV (mkVP sleep_V)) +mkCN woman_N (mkRS (mkRCl which_RP (mkVP always_AdV (mkVP sleep_V)))) mkRCl : RP -> NP -> V2 -> RCl -- who she loves -mkRCl which_RP she_NP love_V2 +mkCN woman_N (mkRS (mkRCl which_RP we_NP love_V2)) mkRCl : RP -> ClSlash -> RCl -- who she loves today --: -mkRCl which_RP (mkClSlash (mkClSlash she_NP love_V2) today_Adv) +mkCN woman_N (mkRS (mkRCl which_RP (mkClSlash (mkClSlash she_NP love_V2) today_Adv))) -- which_RP : RP -- which/who --which_RP mkRP : Prep -> NP -> RP -> RP -- all the cities in which @@ -808,9 +808,9 @@ something_NP somewhere_Adv : Adv somewhere_Adv that_Quant : Quant -that_Quant +mkNP that_Quant house_N that_Subj : Subj -that_Subj +mkAdv that_Subj (mkS (mkCl she_NP sleep_V)) there_Adv : Adv there_Adv there7to_Adv : Adv -- to there @@ -822,7 +822,7 @@ therefore_PConj they_Pron : Pron they_Pron this_Quant : Quant -this_Quant +mkNP this_Quant house_N through_Prep : Prep mkAdv through_Prep it_NP to_Prep : Prep @@ -844,7 +844,7 @@ whatSg_IP when_IAdv : IAdv mkUtt when_IAdv when_Subj : Subj -when_Subj +mkAdv when_Subj (mkS (mkCl she_NP sleep_V)) where_IAdv : IAdv mkUtt where_IAdv which_IQuant : IQuant @@ -868,9 +868,9 @@ youPl_Pron youPol_Pron : Pron -- you (polite) youPol_Pron no_Quant : Quant -no_Quant +mkNP no_Quant house_N not_Predet : Predet -not_Predet +mkNP not_Predet everybody_NP if_then_Conj : Conj mkAdv if_then_Conj here_Adv there_Adv at_least_AdN : AdN diff --git a/lib/doc/synopsis.html b/lib/doc/synopsis.html index 11aecb63d..87e011e3c 100644 --- a/lib/doc/synopsis.html +++ b/lib/doc/synopsis.html @@ -536,17 +536,17 @@ Lexical category, constructors given in mkAP AP -> QS -> AP -
it is uncertain who sleeps
+
it is uncertain who sleeps
mkAP AP -> VP -> AP -
she is ready to sleep
+
she is ready to sleep
mkAP AP -> SC -> AP -
she is ready to sleep
+
she is ready to sleep
mkAP @@ -576,7 +576,7 @@ Lexical category, constructors given in mkAP CAdv -> AP -> NP -> AP -
as old as she
+
as old as she
reflAP @@ -631,17 +631,17 @@ Lexical category, constructors given in almost_AdN AdN -
atomic term almostAdN
+
atomic term almostAdN
at_least_AdN AdN -
at least eight
+
at least eight
at_most_AdN AdN -
at most eight
+
at most eight
mkAdN @@ -786,7 +786,7 @@ Lexical category, constructors given in as_CAdv CAdv -
as
+
as
less_CAdv @@ -796,7 +796,7 @@ Lexical category, constructors given in more_CAdv CAdv -
more
+
more
@@ -886,12 +886,12 @@ Lexical category, constructors given in mkCN CN -> VP -> CN -
reason to sleep
+
reason to sleep
mkCN CN -> SC -> CN -
reason to sleep
+
reason to sleep
mkCN @@ -1011,7 +1011,7 @@ Lexical category, constructors given in mkCl NP -> V2V -> NP -> VP -> Cl -
she begs him to sleep
+
she begs him to sleep
mkCl @@ -1131,12 +1131,12 @@ Lexical category, constructors given in mkClSlash ClSlash -> Adv -> ClSlash -
whom does she see today
+
whom does she see today
mkClSlash NP -> VS -> SSlash -> ClSlash -
whom does she know that we hadn't seen
+
whom does she know that we hadn't seen
@@ -1191,7 +1191,7 @@ Lexical category, constructors given in if_then_Conj Conj -
if here then there
+
if here then there
or_Conj @@ -1211,17 +1211,17 @@ Lexical category, constructors given in aPl_Det Det -
women
+
women
aSg_Det Det -
a woman
+
a woman
a_Det Det -
a house
+
a house
every_Det @@ -1236,7 +1236,7 @@ Lexical category, constructors given in many_Det Det -
many houses
+
many houses
mkDet @@ -1306,17 +1306,17 @@ Lexical category, constructors given in thePl_Det Det -
the houses
+
the houses
theSg_Det Det -
the house
+
the house
the_Det Det -
the house
+
the house
@@ -1416,7 +1416,7 @@ Lexical category, constructors given in how8much_IAdv IAdv -
how much
+
how much
how_IAdv @@ -1496,12 +1496,12 @@ Lexical category, constructors given in whichPl_IDet IDet -
which
+
which houses
which_IDet IDet -
which
+
which house
@@ -1780,12 +1780,12 @@ Lexical category, constructors given in everybody_NP NP -
everybody
+
everybody
everything_NP NP -
everything
+
everything
he_NP @@ -1800,7 +1800,7 @@ Lexical category, constructors given in it_NP NP -
it
+
it
mkNP @@ -1920,7 +1920,7 @@ Lexical category, constructors given in mkNP NP -> Adv -> NP -
Paris today
+
Paris today
mkNP @@ -1940,12 +1940,12 @@ Lexical category, constructors given in nobody_NP NP -
nobody
+
nobody
nothing_NP NP -
nothing
+
nothing
she_NP @@ -1955,12 +1955,12 @@ Lexical category, constructors given in somebody_NP NP -
somebody
+
somebody
something_NP NP -
something
+
something
they_NP @@ -2211,7 +2211,7 @@ Lexical category, constructors given in all_Predet Predet -
all the men
+
all the men
most_Predet @@ -2221,7 +2221,7 @@ Lexical category, constructors given in not_Predet Predet -
not
+
not everybody
only_Predet @@ -2281,12 +2281,12 @@ Lexical category, constructors given in except_Prep Prep -
except it
+
except it
for_Prep Prep -
for it
+
for it
from_Prep @@ -2321,12 +2321,12 @@ Lexical category, constructors given in through_Prep Prep -
atomic term it_Prep
+
through it
to_Prep Prep -
atomic term it_Prep
+
to it
under_Prep @@ -2356,47 +2356,47 @@ Lexical category, constructors given in he_Pron Pron -
he
+
he
i_Pron Pron -
I
+
I
it_Pron Pron -
it
+
it
she_Pron Pron -
she
+
she
they_Pron Pron -
they
+
they
we_Pron Pron -
we
+
we
youPl_Pron Pron -
you
+
you
youPol_Pron Pron -
you
+
you
youSg_Pron Pron -
you
+
you
@@ -2506,7 +2506,7 @@ Lexical category, constructors given in mkQCl IP -> V2V -> NP -> VP -> QCl -
who begs him to sleep
+
who begs him to sleep
mkQCl @@ -2556,7 +2556,7 @@ Lexical category, constructors given in mkQCl IP -> ClSlash -> QCl -
whom does she love today
+
whom does she love today
mkQCl @@ -2616,32 +2616,32 @@ Lexical category, constructors given in a_Quant Quant -
a house
+
a house
mkQuant Pron -> Quant -
my house
+
my house
no_Quant Quant -
no
+
no house
that_Quant Quant -
that
+
that house
the_Quant Quant -
the house
+
the house
this_Quant Quant -
this
+
this house
@@ -2656,122 +2656,122 @@ Lexical category, constructors given in mkRCl RP -> VP -> RCl -
who always sleep
+
woman who always sleeps
mkRCl RP -> V -> RCl -
who sleep
+
woman who sleeps
mkRCl RP -> V2 -> NP -> RCl -
who love her
+
woman who loves him
mkRCl RP -> V3 -> NP -> NP -> RCl -
who send it to her
+
woman who sends it to him
mkRCl RP -> VV -> VP -> RCl -
who want to sleep
+
woman who wants to sleep
mkRCl RP -> VS -> S -> RCl -
who say that I sleep
+
woman who says that I sleep
mkRCl RP -> VQ -> QS -> RCl -
who wonder who sleeps
+
woman who wonders who sleeps
mkRCl RP -> VA -> A -> RCl -
who become old
+
woman who becomes old
mkRCl RP -> VA -> AP -> RCl -
who become very old
+
woman who becomes very old
mkRCl RP -> V2A -> NP -> A -> RCl -
who paint it red
+
woman who paints it red
mkRCl RP -> V2A -> NP -> AP -> RCl -
who paint it red
+
woman who paints it very red
mkRCl RP -> V2S -> NP -> S -> RCl -
who answer to him that we sleep
+
woman who answers to him that we sleep
mkRCl RP -> V2Q -> NP -> QS -> RCl -
who ask him who sleeps
+
woman who asks him who sleeps
mkRCl RP -> V2V -> NP -> VP -> RCl -
who beg him to sleep
+
woman who begs him to sleep
mkRCl RP -> A -> RCl -
who am old
+
woman who is old
mkRCl RP -> A -> NP -> RCl -
who am older than he
+
woman who is older than he
mkRCl RP -> A2 -> NP -> RCl -
who am married to him
+
woman who is married to him
mkRCl RP -> AP -> RCl -
who am very old
+
woman who is very old
mkRCl RP -> NP -> RCl -
who am the woman
+
woman who is the woman
mkRCl RP -> N -> RCl -
who am a woman
+
student who is a woman
mkRCl RP -> CN -> RCl -
who am an old woman
+
student who is an old woman
mkRCl RP -> Adv -> RCl -
who am here
+
woman who is here
mkRCl RP -> NP -> V2 -> RCl -
whom she loves
+
woman whom we love
mkRCl RP -> ClSlash -> RCl -
whom she loves today
+
woman whom she loves today
mkRCl @@ -2811,12 +2811,12 @@ Lexical category, constructors given in mkRS (Tense) -> (Ant) -> (Pol) -> RCl -> RS -
who wouldn't have slept
+
woman who wouldn't have slept
mkRS Conj -> RS -> RS -> RS -
who sleep or whom she loves
+
woman who sleeps or whom we love
mkRS @@ -2851,7 +2851,7 @@ Lexical category, constructors given in mkS Adv -> S -> S -
today , she sleeps
+
today , she sleeps
@@ -2971,12 +2971,12 @@ Lexical category, constructors given in that_Subj Subj -
that
+
that she sleeps
when_Subj Subj -
when
+
when she sleeps
@@ -3308,7 +3308,7 @@ Lexical category, constructors given in mkVP VS -> S -> VP -
to know that she sleeps
+
to know that she sleeps
mkVP @@ -3333,12 +3333,12 @@ Lexical category, constructors given in mkVP V2Q -> NP -> QS -> VP -
to answer to him who sleeps
+
to ask him who sleeps
mkVP V2V -> NP -> VP -> VP -
to beg him to sleep
+
to beg him to sleep
mkVP @@ -3458,7 +3458,7 @@ Lexical category, constructors given in mkVPSlash V2Q -> QS -> VPSlash -
atomic term where_Idv
+
atomic term where_Idv
mkVPSlash @@ -3468,7 +3468,7 @@ Lexical category, constructors given in mkVPSlash V2V -> VP -> VPSlash -
whom does she beg to sleep
+
whom does she beg to sleep
mkVPSlash @@ -3478,7 +3478,7 @@ Lexical category, constructors given in mkVPSlash V2V -> NP -> VPSlash -> VPSlash -
whom does she beg me to see
+
whom does she beg me to see
@@ -3515,7 +3515,7 @@ Lexical category, constructors given in must_VV VV -
have to
+
have to
want_VV