1 unstable release

0.1.0 Jan 2, 2025

#638 in Text processing

Download history 18/week @ 2024-12-27 141/week @ 2025-01-03 6/week @ 2025-01-10

165 downloads per month

MIT license

17KB
539 lines

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/

Dependencies

~190–630KB
~15K SLoC