Expand description
§English Phrase Structure Rules library
A library containing types for building English sentences with strict rules from the linguistics nerds.
use enpsrlib::*;
// I eat green apples.
let sentence = S::simple(
NPCP::NP(NP::from_head(N::new("I"))),
VP::from_head(V::new("eat")).with_noun_phrase(
NP::from_head(N::new("apples"))
.with_adjective_phrase(AdjP::from_head(Adj::new("green"))),
),
);
println!("{:?}", sentence);
Source for now: https://ecampusontario.pressbooks.pub/essentialsoflinguistics2/chapter/a1-1-drawing-phrase-structure-rule-trees/
Structs§
- Adjective
- Adjective
Phrase - Adverb
- Adverbial
Phrase - Auxiliary
- Complementizer
- Complementizer
Phrase - Conjunction
- Degree
Modifier - Determiner
- Negation
- Noun
- Noun
Phrase - Number
- Preposition
- Prepositional
Phrase - Sentence
- Verb
- Verb
Phrase
Enums§
Traits§
- Part
OfSpeech - Phrase
- Word
- Implemented by word types