1 unstable release

0.1.0 Jan 2, 2025

#611 in Text processing

Download history 152/week @ 2024-12-31 9/week @ 2025-01-07

161 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

~215–660KB
~16K SLoC