1
0
forked from GitHub/gf-rgl

fix detcn

This commit is contained in:
2026-04-05 10:31:50 -06:00
parent 786340192f
commit 43979ed054
19 changed files with 317 additions and 23 deletions

60
src/_grphp_1.dot Normal file
View File

@@ -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;
}

BIN
src/_grphp_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

42
src/_grphp_2.dot Normal file
View File

@@ -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;
}

BIN
src/_grphp_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

42
src/_grphp_3.dot Normal file
View File

@@ -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;
}

BIN
src/_grphp_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

52
src/_grphp_4.dot Normal file
View File

@@ -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;
}

BIN
src/_grphp_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

47
src/_grphp_5.dot Normal file
View File

@@ -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;
}

BIN
src/_grphp_5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
src/_grphp_all.pdf Normal file

Binary file not shown.

39
src/_grpht_1.dot Normal file
View File

@@ -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"];
}

BIN
src/_grpht_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@@ -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 ;
}

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -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 ;

View File

@@ -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 =