Main features of proGRAM are
The following example shows the (simplified) specification of the Czech word "kvetiny" (flowers) in this language.
kv�tiny LEXF: kvetina WCL: noun SYNTCL: noun GENDER: fem ? NUM: pl CASE: ? voc , acc , nom ! , NUM: sg CASE: gen ! ENDThis example illustrates the usage of the branching on the level of the whole sets of attributes (branching after the GENDER attribute) and also branching on the level of values (values of the CASE attribute). The entire specification corresponds to four unambiguous definitions. The question mark always denotes the place where the branching begins, commas separate the alternatives and the exclamation mark denotes the end of branching. The branchings can be nested; the resulting set of the descriptions is the set of all possible combinations (Cartesian product).
Commands forming the meta-rules are as follows:
A.SYNTCL=noun
A.CASE ? B.CASE CaseDisagreement
X := B
X.HasRightGenitive := yes
P in A.FRAMESET
DELETE P from A.FRAMESET
IF A.SYNTCL=noun THEN X.a := n ELSE IF A.SYNTCL=pronoun THEN X.a := p ELSE FAIL ENDIF ENDIF
The following example presents the simplified definition of the meta-rule for adjoining the adjective as the left congruent attribute to the noun:
METARULE LeftCongruentAttribute A.SYNTCL=adj B.SYNTCL=noun A.GENDER ? B.GENDER GenderDisagreement A.CASE ? B.CASE CaseDisagreement A.NUMBER ? B.NUMBER NumberDisagreement X:=B OK END_METARULEIf the interpretation of the meta-rule succeeds and all soft-conditions were met then we get the rule of the positive grammar. If any of the soft conditions is not true then the interpretation of the meta-rule continues but the resulting rule will be the negative rule of the extended grammar with the appropriate error code.
The set of attributes and the set of values are not fixed, the author of the grammar can use her/his own attributes and values. The dictionaries of attributes and values are created during the loading of the grammar and the input sentence.
_ sentence.dat Ng:0 Ne:0 op:23RECalled without parameters the parser writes the list of its options:
Params: Input: mx: 0..9 max number of words [unlimited] Parsing: pr: -/+/R parser [-] io: t/./-/d output of new item [t] Analysis: Ng:0..9 restriction by Ng [unlimited] dNg:0..9 restriction by dNg [unlimited] Ne:0..9 restriction by Ne [unlimited] an:n restriction by CLOSEST rules [off] p restrikce by PROJECTIVE rules [off] Output: op: s: statistics A: names of attributes -> ATRIBS.TAB E: names of errors -> ERRORS.TAB V: names of values -> VALUES.TAB R: names of rules -> RULES.TAB C: translated grammar -> CODE.BIN 1: DR-trees -> TREES.OUT 2: DR-shapes -> TREES.OUT 3: De-shapes -> TREES.OUT P: parsing => FS.OUT, POOL.OUT, UPOOL.OUT, DPOOL.OUT
---------------------------------------------------------------------- Step.Delphi (C) Tomas Holan 1993, 2001 3.5.2001 9:15:50 .585 ---------------------------------------------------------------------- Params: > Ng:0 Ne:0 op:23 < parser = ChartParser allowed Ng <= 0 allowed dNg <= 1000 allowed errors <= 0 new item = full print new item = duplicity fail of rule = empty Max.length = unlimited Grammar: extended Sizes of tables: Symbols: 1000 Items: 60000 Complete items: 1000 Duplicite items: 65000 Grammar: rules.dat Rules = 8/1165 star�:1..11 �ena:12..19 zal�vala:20..27 kv�tiny:28..31 v:32..33 rohu:34..37 sv�:38..47 zahrady:48..51 te�ka:52..52 53/19 4:19 [1(0)] 1..2 B(A) Coverage: XX....... 54/23 19:21 [5(0)] 2..3 C(B) Coverage: .XX...... 55/53 19:25 [5(0)] 2..3 C(B) Coverage: .XX...... 56/24 20:29 [4(0)] 3..4 C(D) Coverage: ..XX..... 57/25 21:29 [4(0)] 3..4 C(D) Coverage: ..XX..... 58/54 22:29 [4(0)] 3..4 C(D) Coverage: ..XX..... 59/53 23:29 [4(0)] 3..4 C(D) Coverage: ..XX..... 60/55 32:34 [3(0)] 5..6 F(E) Coverage: ....XX... 61/49 40:49 [2(0)] 7..8 H(G) Coverage: ......XX. 62/50 41:50 [2(0)] 7..8 H(G) Coverage: ......XX. 63/51 47:51 [2(0)] 7..8 H(G) Coverage: ......XX. 64/23 53:21 [5(0)] 1..3 C(B(A)) Coverage: XXX...... 65/53 53:25 [5(0)] 1..3 C(B(A)) Coverage: XXX...... 66/53 54:29 [4(0)] 2..4 C(BD) Coverage: .XXX..... 67/53 19:57 [5(0)] 2..4 C(BD) Coverage: .XXX..... 67/53 53:57 [5(0)] 1..4 C(B(A)D) Coverage: XXXX..... 68/56 28:60 [6(0)] 4..6 D(F(E)) Coverage: ...XXX... 69/57 29:60 [6(0)] 4..6 D(F(E)) Coverage: ...XXX... 70/58 30:60 [6(0)] 4..6 D(F(E)) Coverage: ...XXX... 71/59 31:60 [6(0)] 4..6 D(F(E)) Coverage: ...XXX... 72/24 56:60 [6(0)] 3..6 C(DF(E)) Coverage: ..XXXX... 73/25 57:60 [6(0)] 3..6 C(DF(E)) Coverage: ..XXXX... 74/54 58:60 [6(0)] 3..6 C(DF(E)) Coverage: ..XXXX... 75/53 59:60 [6(0)] 3..6 C(DF(E)) Coverage: ..XXXX... 76/60 34:63 [7(0)] 6..8 F(H(G)) Coverage: .....XXX. 77/61 35:63 [7(0)] 6..8 F(H(G)) Coverage: .....XXX. 78/62 36:63 [7(0)] 6..8 F(H(G)) Coverage: .....XXX. 79/63 37:63 [7(0)] 6..8 F(H(G)) Coverage: .....XXX. 80/53 64:29 [4(0)] 1..4 C(B(A)D) Coverage: XXXX..... 80/53 66:60 [6(0)] 2..6 C(BDF(E)) Coverage: .XXXXX... 81/53 67:60 [6(0)] 1..6 C(B(A)DF(E)) Coverage: XXXXXX... 82/24 20:69 [4(0)] 3..6 C(D(F(E))) Coverage: ..XXXX... 82/25 21:69 [4(0)] 3..6 C(D(F(E))) Coverage: ..XXXX... 82/54 22:69 [4(0)] 3..6 C(D(F(E))) Coverage: ..XXXX... 82/53 23:69 [4(0)] 3..6 C(D(F(E))) Coverage: ..XXXX... 82/53 54:69 [4(0)] 2..6 C(BD(F(E))) Coverage: .XXXXX... 82/53 64:69 [4(0)] 1..6 C(B(A)D(F(E))) Coverage: XXXXXX... 82/53 19:73 [5(0)] 2..6 C(BDF(E)) Coverage: .XXXXX... 82/53 53:73 [5(0)] 1..6 C(B(A)DF(E)) Coverage: XXXXXX... 82/64 32:76 [3(0)] 5..8 F(EH(G)) Coverage: ....XXXX. 83/56 28:82 [6(0)] 4..8 D(F(EH(G))) Coverage: ...XXXXX. 84/57 29:82 [6(0)] 4..8 D(F(EH(G))) Coverage: ...XXXXX. 85/58 30:82 [6(0)] 4..8 D(F(EH(G))) Coverage: ...XXXXX. 86/59 31:82 [6(0)] 4..8 D(F(EH(G))) Coverage: ...XXXXX. 87/24 56:82 [6(0)] 3..8 C(DF(EH(G))) Coverage: ..XXXXXX. 88/25 57:82 [6(0)] 3..8 C(DF(EH(G))) Coverage: ..XXXXXX. 89/54 58:82 [6(0)] 3..8 C(DF(EH(G))) Coverage: ..XXXXXX. 90/53 59:82 [6(0)] 3..8 C(DF(EH(G))) Coverage: ..XXXXXX. 91/53 66:82 [6(0)] 2..8 C(BDF(EH(G))) Coverage: .XXXXXXX. 92/53 67:82 [6(0)] 1..8 C(B(A)DF(EH(G))) Coverage: XXXXXXXX. 93/24 20:84 [4(0)] 3..8 C(D(F(EH(G)))) Coverage: ..XXXXXX. 93/25 21:84 [4(0)] 3..8 C(D(F(EH(G)))) Coverage: ..XXXXXX. 93/54 22:84 [4(0)] 3..8 C(D(F(EH(G)))) Coverage: ..XXXXXX. 93/53 23:84 [4(0)] 3..8 C(D(F(EH(G)))) Coverage: ..XXXXXX. 93/53 54:84 [4(0)] 2..8 C(BD(F(EH(G)))) Coverage: .XXXXXXX. 93/53 64:84 [4(0)] 1..8 C(B(A)D(F(EH(G)))) Coverage: XXXXXXXX. 93/65 87:52 [8(0)] 3..9 C(DF(EH(G))I) Coverage: ..XXXXXXX 94/53 19:88 [5(0)] 2..8 C(BDF(EH(G))) Coverage: .XXXXXXX. 94/66 88:52 [8(0)] 3..9 C(DF(EH(G))I) Coverage: ..XXXXXXX 95/53 53:88 [5(0)] 1..8 C(B(A)DF(EH(G))) Coverage: XXXXXXXX. 95/67 89:52 [8(0)] 3..9 C(DF(EH(G))I) Coverage: ..XXXXXXX 96/68 90:52 [8(0)] 3..9 C(DF(EH(G))I) Coverage: ..XXXXXXX 97/68 91:52 [8(0)] 2..9 C(BDF(EH(G))I) Coverage: .XXXXXXXX 98/68 92:52 [8(0)] 1..9 C(B(A)DF(EH(G))I) Coverage: XXXXXXXXX 0.22s FS..................... 68 Items ................. 97 Complete items ........ 1 Duplicite items ....... 18 DR-trees (5) 0: U1(-16(64(53(4,19),21),84(29,82(32,76(34,63(47,51))))),52) 1: U1(-18(53(4,19),-12(21,84(29,82(32,76(34,63(47,51)))))),52) 2: U1(-18(53(4,19),88(57(21,29),82(32,76(34,63(47,51))))),52) 3: U1(92(-2(64(53(4,19),21),29),82(32,76(34,63(47,51)))),52) 4: U1(92(67(53(4,19),57(21,29)),82(32,76(34,63(47,51)))),52) DR-Shapes (5) 0: C:8(C:4(C:5(B:1(A,B),C),D:6(D,F:3(E,F:7(F,H:2(G,H))))),I) 1: C:8(C:5(B:1(A,B),C:4(C,D:6(D,F:3(E,F:7(F,H:2(G,H)))))),I) 2: C:8(C:5(B:1(A,B),C:6(C:4(C,D),F:3(E,F:7(F,H:2(G,H))))),I) 3: C:8(C:6(C:4(C:5(B:1(A,B),C),D),F:3(E,F:7(F,H:2(G,H)))),I) 4: C:8(C:6(C:5(B:1(A,B),C:4(C,D)),F:3(E,F:7(F,H:2(G,H)))),I) De-Shapes (2) 0: 0 C:0(B:5(A:1),D:4(F:6(E:3,H:7(G:2))),I:8) 1: 0 C:0(B:5(A:1),D:4,F:6(E:3,H:7(G:2)),I:8) 0.22s (C) Tomas Holan 1993, 2001
star� ? lexf: stara2 wcl: adj syntcl: adj minx: 2 adj_type: ord deg: pos nomform: no neg: no ? gender: neut num: pl du: no case: ? acc , nom ! , gender: fem num: sg du: no case: ? voc , nom ! ! cycle: yes , lexf: starat wcl: vb syntcl: v v_cl: full refl: se aspect: impf FRAMESET: ? ( [ ACTANT: act CASE: nom PREP: 0 ] [ ACTANT: pat CASE: acc PREP: 0 ] ) cycle: no , ( [ ACTANT: act CASE: nom PREP: 0 ] [ ACTANT: pat CASE: clause PREP: aby ] ) cycle: no , ( [ ACTANT: pat CASE: acc PREP: 0 ] ) cycle: no , ( [ ACTANT: pat CASE: clause PREP: aby ] ) cycle: no , ( ) cycle: yes ! mode: ind neg: no v_form: fin pers: 3 num: sg tense: pres , lexf: stary2 wcl: noun syntcl: noun minx: 1 tant: 0 refl: 0 gender: fem num: sg du: no case: ? voc , nom ! cycle: yes ! END �ena ? LEXF: hna2t WCL: vb SYNTCL: v FRAMESET: ? ( [ ACTANT: act CASE: nom PREP: 0 ] [ ACTANT: pat CASE: acc PREP: 0 ] [ ACTANT: oadv ] ) cycle: no , ( [ ACTANT: pat CASE: acc PREP: 0 ] ) cycle: no , ( [ ACTANT: pat CASE: acc PREP: 0 ] [ ACTANT: oadv ] ) cycle: no , ( [ ACTANT: act CASE: nom PREP: 0 ] ) cycle: no , ( [ ACTANT: act CASE: nom PREP: 0 ] [ ACTANT: oadv ] ) cycle: no , ( [ ACTANT: oadv ] ) cycle: no , ( ) cycle: yes ! NEG: no PERS: tecka NUM: sg RTENSE: con , LEXF: z3ena WCL: noun SYNTCL: noun TANT: 0 REFL: 0 GENDER: fem NUM: sg DU: no CASE: nom depprn: yes depnum: yes RIGHTGEN: yes cycle: yes ! END zal�vala LEXF: zale2vat WCL: vb SYNTCL: v FRAMESET: ? ( [ ACTANT: act CASE: nom PREP: 0 ] [ ACTANT: pat CASE: acc PREP: 0 ] ) cycle: no , ( [ ACTANT: pat CASE: acc PREP: 0 ] ) cycle: no , ( [ ACTANT: act CASE: nom PREP: 0 ] ) cycle: no , ( ) cycle: yes ! ? GENDER: neut NUM: pl , GENDER: fem NUM: sg ! END kv�tiny LEXF: kve3tina WCL: noun SYNTCL: noun TANT: 0 GENDER: fem ? NUM: pl DU: no CASE: ? voc , acc , nom ! , NUM: sg DU: no CASE: gen ! depprn: yes depnum: yes RIGHTGEN: yes CYCLE: yes END v LEXF: v WCL: prep SYNTCL: prep CASE: ? loc , acc ! CYCLE: yes END rohu LEXF: roh WCL: noun SYNTCL: noun TANT: 0 GENDER: inan NUM: sg DU: no CASE: ? loc , voc , dat , gen ! depprn: yes depnum: yes RIGHTGEN: yes CYCLE: yes END sv� LEXF: svuj WCL: prn SYNTCL: adj ? GENDER: inan DU: pl CASE: ? acc , nom ! , GENDER: fem NUM: pl DU: no CASE: ? acc , nom ! , GENDER: anim NUM: pl DU: no CASE: nom , GENDER: neut NUM: sg DU: no CASE: ? acc , nom ! , GENDER: fem NUM: sg DU: no CASE: ? loc , dat , gen ! ! CYCLE: yes END zahrady LEXF: zahrada WCL: noun SYNTCL: noun TANT: 0 GENDER: fem ? NUM: pl DU: no CASE: ? voc , acc , nom ! , NUM: sg DU: no CASE: gen ! depprn: yes depnum: yes RIGHTGEN: yes CYCLE: yes END te�ka LEXF: period WCL: int SYNTCL: int END