minimalist_grammar_parser/
grammars.rs

1//! This module defines a few example grammars that can be useful in testing or otherwise.
2
3///The grammar from Stabler (2013)
4///
5/// - Stabler, E. (2013). Two Models of Minimalist, Incremental Syntactic Analysis. Topics in Cognitive Science, 5(3), 611–633. <https://doi.org/10.1111/tops.12031>
6pub const STABLER2011: &str = "::V= C
7::V= +W C
8knows::C= =D V
9says::C= =D V
10prefers::D= =D V
11drinks::D= =D V
12king::N
13wine::N
14beer::N
15queen::N
16the::N= D
17which::N= D -W";
18
19///A version of [`STABLER2011`] without embedded clauses.
20pub const SIMPLESTABLER2011: &str = "::V= C
21::V= +W C
22likes::D= =D V
23queen::N
24king::N
25the::N= D
26which::N= D -W";
27
28///The copy language (any string of a's and b's repeated twice).
29pub const COPY_LANGUAGE: &str = "::=T +r +l T
30::T -r -l
31a::=A +l T -l
32a::=T +r A -r
33b::=B +l T -l
34b::=T +r B -r";
35
36///The same copy language as above but showing the placement of the unprounced words
37pub const ALT_COPY_LANGUAGE: &str = "E::=T +r +l T
38S::T -r -l
39a::=A +l T -l
40a::=T +r A -r
41b::=B +l T -l
42b::=T +r B -r";
43
44///The [Dyck language](https://en.wikipedia.org/wiki/Dyck_language) or the language of balanced
45///parentheses.
46pub const DYCK_LANGUAGE: &str = "(::S= R= S\n)::S= R\n::S";