diff --git a/src/_grphp_1.dot b/src/_grphp_1.dot new file mode 100644 index 000000000..22fbb2121 --- /dev/null +++ b/src/_grphp_1.dot @@ -0,0 +1,60 @@ +graph { +edge[style="solid"]; node[shape="plaintext"]; +subgraph {rank=same; + n18[label="Phr"]; +} + +subgraph {rank=same; + n16[label="Utt"]; +} +n18 -- n16[label="dep#1"]; + +subgraph {rank=same; + n15[label="S"]; +} +n16 -- n15 + +subgraph {rank=same; + n14[label="Cl"]; +} +n15 -- n14[label="dep#2"]; + +subgraph {rank=same; + n6[label="NP"]; + n13[label="VP"]; + edge[style="invis"]; + n6 -- n13 ; +} +n14 -- n6 +n14 -- n13[label="dep#1"]; + +subgraph {rank=same; + n5[label="Pron"]; + n8[label="VPSlash"]; + edge[style="invis"]; + n5 -- n8 ; +} +n6 -- n5 +n13 -- n8 + +subgraph {rank=same; + n7[label="V2"]; +} +n8 -- n7 + +edge[style="dashed"]; node[shape="plaintext"]; +subgraph {rank=same; + n100000[label="Pron +I"]; + n100001[label="Cl +don't"]; + n100002[label="V2 +know"]; + edge[style="invis"]; + n100000 -- n100001 -- n100002 ; +} +n5 -- n100000; +n14 -- n100001; +n7 -- n100002; + +} \ No newline at end of file diff --git a/src/_grphp_1.png b/src/_grphp_1.png new file mode 100644 index 000000000..22df328bb Binary files /dev/null and b/src/_grphp_1.png differ diff --git a/src/_grphp_2.dot b/src/_grphp_2.dot new file mode 100644 index 000000000..4fe5dff8c --- /dev/null +++ b/src/_grphp_2.dot @@ -0,0 +1,42 @@ +graph { +edge[style="solid"]; node[shape="plaintext"]; +subgraph {rank=same; + n12[label="PhrUtt : Phr"]; +} + +subgraph {rank=same; + n10[label="UttImpPol : Utt"]; +} +n12 -- n10; + +subgraph {rank=same; + n9[label="ImpVP : Imp"]; +} +n10 -- n9; + +subgraph {rank=same; + n8[label="ComplSlash : VP"]; +} +n9 -- n8; + +subgraph {rank=same; + n3[label="SlashV2a : VPSlash"]; +} +n8 -- n3; + +subgraph {rank=same; + n2[label="know_V2 : V2"]; +} +n3 -- n2; + +edge[style="dashed"]; node[shape="plaintext"]; +subgraph {rank=same; + n100000[label="don't"]; + n100001[label="know"]; + edge[style="invis"]; + n100000 -- n100001 ; +} +n9 -- n100000; +n2 -- n100001; + +} \ No newline at end of file diff --git a/src/_grphp_2.png b/src/_grphp_2.png new file mode 100644 index 000000000..06024ce48 Binary files /dev/null and b/src/_grphp_2.png differ diff --git a/src/_grphp_3.dot b/src/_grphp_3.dot new file mode 100644 index 000000000..74bc48898 --- /dev/null +++ b/src/_grphp_3.dot @@ -0,0 +1,42 @@ +graph { +edge[style="solid"]; node[shape="plaintext"]; +subgraph {rank=same; + n12[label="PhrUtt : Phr"]; +} + +subgraph {rank=same; + n10[label="UttImpSg : Utt"]; +} +n12 -- n10; + +subgraph {rank=same; + n9[label="ImpVP : Imp"]; +} +n10 -- n9; + +subgraph {rank=same; + n8[label="ComplSlash : VP"]; +} +n9 -- n8; + +subgraph {rank=same; + n3[label="SlashV2a : VPSlash"]; +} +n8 -- n3; + +subgraph {rank=same; + n2[label="know_V2 : V2"]; +} +n3 -- n2; + +edge[style="dashed"]; node[shape="plaintext"]; +subgraph {rank=same; + n100000[label="don't"]; + n100001[label="know"]; + edge[style="invis"]; + n100000 -- n100001 ; +} +n9 -- n100000; +n2 -- n100001; + +} \ No newline at end of file diff --git a/src/_grphp_3.png b/src/_grphp_3.png new file mode 100644 index 000000000..aa39f422a Binary files /dev/null and b/src/_grphp_3.png differ diff --git a/src/_grphp_4.dot b/src/_grphp_4.dot new file mode 100644 index 000000000..2a40cefe3 --- /dev/null +++ b/src/_grphp_4.dot @@ -0,0 +1,52 @@ +graph { +edge[style="solid"]; node[shape="plaintext"]; +subgraph {rank=same; + n21[label="PhrUtt : Phr"]; +} + +subgraph {rank=same; + n19[label="UttQS : Utt"]; +} +n21 -- n19; + +subgraph {rank=same; + n18[label="UseQCl : QS"]; +} +n19 -- n18; + +subgraph {rank=same; + n17[label="QuestCl : QCl"]; +} +n18 -- n17; + +subgraph {rank=same; + n16[label="PredVP : Cl"]; +} +n17 -- n16; + +subgraph {rank=same; + n15[label="ComplSlash : VP"]; +} +n16 -- n15; + +subgraph {rank=same; + n10[label="SlashV2a : VPSlash"]; +} +n15 -- n10; + +subgraph {rank=same; + n9[label="know_V2 : V2"]; +} +n10 -- n9; + +edge[style="dashed"]; node[shape="plaintext"]; +subgraph {rank=same; + n100000[label="don't"]; + n100001[label="know"]; + edge[style="invis"]; + n100000 -- n100001 ; +} +n16 -- n100000; +n9 -- n100001; + +} \ No newline at end of file diff --git a/src/_grphp_4.png b/src/_grphp_4.png new file mode 100644 index 000000000..9ac486ed7 Binary files /dev/null and b/src/_grphp_4.png differ diff --git a/src/_grphp_5.dot b/src/_grphp_5.dot new file mode 100644 index 000000000..d351b9145 --- /dev/null +++ b/src/_grphp_5.dot @@ -0,0 +1,47 @@ +graph { +edge[style="solid"]; node[shape="plaintext"]; +subgraph {rank=same; + n20[label="PhrUtt : Phr"]; +} + +subgraph {rank=same; + n18[label="UttS : Utt"]; +} +n20 -- n18; + +subgraph {rank=same; + n17[label="UseCl : S"]; +} +n18 -- n17; + +subgraph {rank=same; + n16[label="PredVP : Cl"]; +} +n17 -- n16; + +subgraph {rank=same; + n15[label="ComplSlash : VP"]; +} +n16 -- n15; + +subgraph {rank=same; + n10[label="SlashV2a : VPSlash"]; +} +n15 -- n10; + +subgraph {rank=same; + n9[label="know_V2 : V2"]; +} +n10 -- n9; + +edge[style="dashed"]; node[shape="plaintext"]; +subgraph {rank=same; + n100000[label="don't"]; + n100001[label="know"]; + edge[style="invis"]; + n100000 -- n100001 ; +} +n16 -- n100000; +n9 -- n100001; + +} \ No newline at end of file diff --git a/src/_grphp_5.png b/src/_grphp_5.png new file mode 100644 index 000000000..60f33e467 Binary files /dev/null and b/src/_grphp_5.png differ diff --git a/src/_grphp_all.pdf b/src/_grphp_all.pdf new file mode 100644 index 000000000..31b1beecb Binary files /dev/null and b/src/_grphp_all.pdf differ diff --git a/src/_grpht_1.dot b/src/_grpht_1.dot new file mode 100644 index 000000000..36bedb95d --- /dev/null +++ b/src/_grpht_1.dot @@ -0,0 +1,39 @@ +graph { +n0[label = "PhrUtt : Phr", style = "solid", shape = "plaintext"] ; +n0_0[label = "NoPConj : PConj", style = "solid", shape = "plaintext"] ; +n0 -- n0_0 [style = "solid"]; +n1_0[label = "UttS : Utt", style = "solid", shape = "plaintext"] ; +n0 -- n1_0 [style = "solid"]; +n0_1_0[label = "UseCl : S", style = "solid", shape = "plaintext"] ; +n1_0 -- n0_1_0 [style = "solid"]; +n0_0_1_0[label = "TTAnt : Temp", style = "solid", shape = "plaintext"] ; +n0_1_0 -- n0_0_1_0 [style = "solid"]; +n0_0_0_1_0[label = "TPres : Tense", style = "solid", shape = "plaintext"] ; +n0_0_1_0 -- n0_0_0_1_0 [style = "solid"]; +n1_0_0_1_0[label = "ASimul : Ant", style = "solid", shape = "plaintext"] ; +n0_0_1_0 -- n1_0_0_1_0 [style = "solid"]; +n1_0_1_0[label = "PNeg : Pol", style = "solid", shape = "plaintext"] ; +n0_1_0 -- n1_0_1_0 [style = "solid"]; +n2_0_1_0[label = "PredVP : Cl", style = "solid", shape = "plaintext"] ; +n0_1_0 -- n2_0_1_0 [style = "solid"]; +n0_2_0_1_0[label = "UsePron : NP", style = "solid", shape = "plaintext"] ; +n2_0_1_0 -- n0_2_0_1_0 [style = "solid"]; +n0_0_2_0_1_0[label = "i_Pron : Pron", style = "solid", shape = "plaintext"] ; +n0_2_0_1_0 -- n0_0_2_0_1_0 [style = "solid"]; +n1_2_0_1_0[label = "ComplSlash : VP", style = "solid", shape = "plaintext"] ; +n2_0_1_0 -- n1_2_0_1_0 [style = "solid"]; +n0_1_2_0_1_0[label = "SlashV2a : VPSlash", style = "solid", shape = "plaintext"] ; +n1_2_0_1_0 -- n0_1_2_0_1_0 [style = "solid"]; +n0_0_1_2_0_1_0[label = "know_V2 : V2", style = "solid", shape = "plaintext"] ; +n0_1_2_0_1_0 -- n0_0_1_2_0_1_0 [style = "solid"]; +n1_1_2_0_1_0[label = "DetNP : NP", style = "solid", shape = "plaintext"] ; +n1_2_0_1_0 -- n1_1_2_0_1_0 [style = "solid"]; +n0_1_1_2_0_1_0[label = "DetQuant : Det", style = "solid", shape = "plaintext"] ; +n1_1_2_0_1_0 -- n0_1_1_2_0_1_0 [style = "solid"]; +n0_0_1_1_2_0_1_0[label = "IndefArt : Quant", style = "solid", shape = "plaintext"] ; +n0_1_1_2_0_1_0 -- n0_0_1_1_2_0_1_0 [style = "solid"]; +n1_0_1_1_2_0_1_0[label = "NumPl : Num", style = "solid", shape = "plaintext"] ; +n0_1_1_2_0_1_0 -- n1_0_1_1_2_0_1_0 [style = "solid"]; +n2_0[label = "NoVoc : Voc", style = "solid", shape = "plaintext"] ; +n0 -- n2_0 [style = "solid"]; +} \ No newline at end of file diff --git a/src/_grpht_1.png b/src/_grpht_1.png new file mode 100644 index 000000000..03976d8f7 Binary files /dev/null and b/src/_grpht_1.png differ diff --git a/src/toki-pona/CatTok.gf b/src/toki-pona/CatTok.gf index 5f93a4278..15dba7226 100644 --- a/src/toki-pona/CatTok.gf +++ b/src/toki-pona/CatTok.gf @@ -35,8 +35,7 @@ concrete CatTok of Cat = CommonX ** open ResTok, Coordination, Prelude in { --2 Verb phrases -- Constructed in VerbTok. - VP = ResTok.LinVP ; - VPSlash = SS ; + VP,VPSlash = ResTok.LinVP ; Comp = SS ; --2 Adjectival phrases @@ -115,7 +114,7 @@ concrete CatTok of Cat = CommonX ** open ResTok, Coordination, Prelude in { SN = SS ; -- Second name, e.g. "Washington" LN = SS ; -- Location name, e.g. "Sweden" - linref - Cl = linCl ; + -- linref + -- Cl = linCl ; } diff --git a/src/toki-pona/LexiconTok.gf b/src/toki-pona/LexiconTok.gf index ce40160e8..3ebdc03c6 100644 --- a/src/toki-pona/LexiconTok.gf +++ b/src/toki-pona/LexiconTok.gf @@ -11,7 +11,7 @@ concrete LexiconTok of Lexicon = CatTok ** lin animal_N = mkN "soweli" ; -- lin answer_V2S = mkV2S (mkV "") ; lin apartment_N = mkN "tomo" ; --- lin apple_N = mkN "" ; +lin apple_N = mkN "kili" ; -- lin art_N = mkN "" ; -- lin ashes_N = mkN "" ; -- lin ask_V2Q = mkV2Q (mkV "") ; @@ -106,7 +106,7 @@ lin dog_N = mkN "soweli" ; lin ear_N = mkN "kute" ; lin earth_N = mkN "ma" ; -lin eat_V2 = mkV "eat" ; +lin eat_V2 = mkV "moku" ; -- lin egg_N = mkN "" ; -- lin empty_A = mkA "" ; -- lin enemy_N = mkN "" ; @@ -139,7 +139,7 @@ lin fish_N = mkN "kala" ; -- lin forget_V2 = mkV2 "" ; -- lin freeze_V = mkV "" ; -- lin fridge_N = mkN "" ; --- lin friend_N = mkN "" ; +lin friend_N = mkN "jan pona" ; lin fruit_N = mkN "kili" ; -- lin full_A = mkA "" ; -- --lin fun_AV diff --git a/src/toki-pona/NounTok.gf b/src/toki-pona/NounTok.gf index 801fd72f1..2a12f91d7 100644 --- a/src/toki-pona/NounTok.gf +++ b/src/toki-pona/NounTok.gf @@ -77,6 +77,8 @@ concrete NounTok of Noun = CatTok ** open ResTok, Prelude in { -- } ; + NumSg,NumPljk = ss [] ; + -- Whether the resulting determiner is singular or plural depends on the -- cardinal. diff --git a/src/toki-pona/ResTok.gf b/src/toki-pona/ResTok.gf index a6795474b..47e8c5194 100644 --- a/src/toki-pona/ResTok.gf +++ b/src/toki-pona/ResTok.gf @@ -1,5 +1,5 @@ --# -path=.:../abstract:../common:../prelude -resource ResTok = open Prelude, Predef in { +resource ResTok = open Prelude, Predef, ParamX in { -------------------------------------------------------------------------------- -- General notes @@ -233,14 +233,14 @@ oper -- VP LinVP : Type = { - s : Str ; + s : Polarity => Str ; } ; LinVPSlash : Type = LinVP ** { c2 : LinPrep ; } ; - linVP : LinVP -> Str = \vp -> vp.s ; + -- linVP : LinVP -> Str = \vp -> vp.s ; -------------------------------------------------------------------------------- -- Cl, S @@ -248,7 +248,7 @@ oper -- Operations for clauses, sentences LinCl : Type = { subj : Str ; - pred : Str ; -- TODO: depend on Temp and Pol + pred : Polarity => Str ; -- TODO: depend on Temp and Pol } ; -- linCl : LinCl -> Str = \cl -> case cl.subj of { @@ -256,7 +256,7 @@ oper -- _ => cl.subj ++ "li" ++ cl.pred -- } ; - linCl : LinCl -> Str = \cl -> cl.subj ++ cl.pred ; + -- linCl : LinCl -> Str = \cl -> cl.subj ++ cl.pred ; -- Preverb, VV diff --git a/src/toki-pona/SentenceTok.gf b/src/toki-pona/SentenceTok.gf index 240126e49..d70419390 100644 --- a/src/toki-pona/SentenceTok.gf +++ b/src/toki-pona/SentenceTok.gf @@ -11,9 +11,9 @@ lin -- : NP -> VP -> Cl PredVP np vp = { subj = np.s ; -- ! Nom, if there are cases - pred = case np.li of { - MiSina => vp.s ; - NotMiSina => "li" ++ vp.s + pred = \\pol => case np.li of { + MiSina => vp.s ! pol ; + NotMiSina => "li" ++ vp.s ! pol } ; } ; @@ -49,7 +49,7 @@ lin -- : Temp -> Pol -> Cl -> S ; UseCl t p cl = { - s = cl.subj ++ t.s ++ p.s ++ cl.pred -- ! t.t ! p.p -- eventually + s = cl.subj ++ t.s ++ p.s ++ cl.pred ! p.p } ; {- -- : Temp -> Pol -> QCl -> QS ; diff --git a/src/toki-pona/VerbTok.gf b/src/toki-pona/VerbTok.gf index 68b731c86..b58bfebd5 100644 --- a/src/toki-pona/VerbTok.gf +++ b/src/toki-pona/VerbTok.gf @@ -1,4 +1,4 @@ -concrete VerbTok of Verb = CatTok ** open ResTok, AdverbTok, Prelude in { +concrete VerbTok of Verb = CatTok ** open ResTok, AdverbTok, Prelude, ParamX in { lin @@ -8,7 +8,12 @@ lin -- : V -> VP -- NB. assumes that lincat V = lincat VP -- This will most likely change when you start working with VPs - UseV v = v ; + UseV v = { + s = table { + Pos => v.s ; + Neg => v.s ++ "ala" + } ; + } ; -- : V2 -> VP ; -- PassV2 v2 = @@ -17,7 +22,7 @@ lin ReflVP vps = vps ; -- : VV -> VP -> VP ; - ComplVV vv vp = { s = vv.s ++ vp.s ;} ; + ComplVV vv vp = { s = \\p => vv.s ++ vp.s ! p ;} ; {- -- : VS -> S -> VP ; @@ -35,7 +40,12 @@ lin -------- -- Slash -- : V2 -> VPSlash - SlashV2a v2 = v2 ; + SlashV2a = \v2 -> { + s = table { + Pos => v2.s ; + Neg => v2.s ++ "ala" + } ; + } ; -- : V3 -> NP -> VPSlash ; -- give it (to her) -- Slash2V3 v3 dobj = @@ -60,11 +70,12 @@ lin -- : VPSlash -> NP -> VP -- Often VPSlash has a field called c2, which is used to pick right form of np complement - ComplSlash vps np = ss (vps.s ++ "e" ++ np.s) ; + ComplSlash vps np = { + s = \\p => vps.s ! p ++ "e" ++ np.s + } ; -- : VV -> VPSlash -> VPSlash ; - -- SlashVV vv vps = ComplVV vv vps ** { - -- } ; + SlashVV vv vps = ComplVV vv vps; -- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy -- SlashV2VNP v2v np vps =