Skip to content

Instantly share code, notes, and snippets.

@derekmerck
Created June 30, 2022 16:52
Show Gist options
  • Save derekmerck/470b5839aa4f8c3e3b3b3aab08458f0a to your computer and use it in GitHub Desktop.
Save derekmerck/470b5839aa4f8c3e3b3b3aab08458f0a to your computer and use it in GitHub Desktop.
Output from a rules based English language parser
flowchart TD
  A[sentence]
  A --> B(independent_clause)
  B --> C(clause)
  C --> D(subject)
  D --> E(noun_phrase)
  E --> |NOUN|F[She]
  C --> G(predicate)
  G --> H(verb_phrase)
  H --> I(verb_phrase)
  I --> |VERB|J[opens]
  H --> K(noun_phrase)
  K --> |DETERMINER|L[her]
  K --> M(noun_phrase)
  M --> |NOUN|N[mouth]
  A --> O(dependent_clause)
  O --> P(subordinating_conjunction)
  P --> |SCONJ|Q[so]
  O --> R(clause)
  R --> S(subject)
  S --> T(noun_phrase)
  T --> |NOUN|U[he]
  R --> V(predicate)
  V --> W(verb_phrase)
  W --> X(verb_phrase)
  X --> |MODAL|Y[can]
  X --> Z(verb_phrase)
  Z --> |VERB|AA[put]
  W --> AB(noun_phrase)
  AB --> |DETERMINER|AC[his]
  AB --> AD(noun_phrase)
  AD --> |NOUN|AE[sandwich]
  W --> AF(prepositional_phrase)
  AF --> |IN|AG[into]
  AF --> AH(noun_phrase)
  AH --> |NOUN|AI[her]
  A --> |PUNCT|AJ[.]
flowchart TD
  A[sentence]
  A --> B(independent_clause)
  B --> C(clause)
  C --> D(subject)
  D --> E(noun_phrase)
  E --> |NOUN|F[He]
  C --> G(predicate)
  G --> H(verb_phrase)
  H --> I(verb_phrase)
  I --> J(verb_phrase)
  J --> |VERB|K[begins]
  I --> L(infinitive)
  L --> |TO|M[to]
  L --> N(adverb_phrase)
  N --> |ADV|O[carefully]
  L --> |VERB|P[put]
  H --> Q(noun_phrase)
  Q --> |DETERMINER|R[his]
  Q --> S(noun_phrase)
  S --> |NOUN|T[sandwich]
  H --> U(prepositional_phrase)
  U --> |IN|V[into]
  U --> W(noun_phrase)
  W --> |NOUN|X[her]
  A --> |PUNCT|Y[.]
flowchart TD
  A[sentence]
  A --> B(independent_clause)
  B --> C(clause)
  C --> D(subject)
  D --> E(noun_phrase)
  E --> |NOUN|F[She]
  C --> G(predicate)
  G --> H(verb_phrase)
  H --> I(verb_phrase)
  I --> J(adverb_phrase)
  J --> |ADV|K[greedily]
  I --> L(verb_phrase)
  L --> |VERB|M[enjoys]
  H --> N(noun_phrase)
  N --> |DETERMINER|O[his]
  N --> P(noun_phrase)
  P --> |NOUN|Q[sandwich]
  A --> |PUNCT|R[.]
flowchart TD
  A[sentence]
  A --> B(independent_clause)
  B --> C(clause)
  C --> D(subject)
  D --> E(noun_phrase)
  E --> F(noun_phrase)
  F --> |NOUN|G[Saliva]
  E --> |CCONJ|H[and]
  E --> I(noun_phrase)
  I --> |NOUN|J[crumbs]
  C --> K(predicate)
  K --> L(verb_phrase)
  L --> M(verb_phrase)
  M --> |VERB|N[run]
  M --> |PARTICLE|O[down]
  L --> P(noun_phrase)
  P --> |DETERMINER|Q[her]
  P --> R(noun_phrase)
  R --> |NOUN|S[chin]
  A --> T(dependent_clause)
  T --> U(subordinating_conjunction)
  U --> |IN|V[as]
  T --> W(clause)
  W --> X(subject)
  X --> Y(noun_phrase)
  Y --> |NOUN|Z[she]
  W --> AA(predicate)
  AA --> AB(verb_phrase)
  AB --> |VERB|AC[eats]
  A --> |PUNCT|AD[.]
flowchart TD
  A[sentence]
  A --> B(independent_clause)
  B --> C(clause)
  C --> D(subject)
  D --> E(noun_phrase)
  E --> |NOUN|F[He]
  C --> G(predicate)
  G --> H(verb_phrase)
  H --> I(verb_phrase)
  I --> J(verb_phrase)
  J --> |VERB|K[stops]
  I --> |VERB|L[feeding]
  H --> M(noun_phrase)
  M --> |NOUN|N[her]
  A --> |CCONJ|O[and]
  A --> P(independent_clause)
  P --> Q(clause)
  Q --> R(subject)
  R --> S(noun_phrase)
  S --> |NOUN|T[she]
  Q --> U(predicate)
  U --> V(verb_phrase)
  V --> W(verb_phrase)
  W --> |VERB|X[moans]
  V --> Y(adverb_phrase)
  Y --> Z(prepositional_phrase)
  Z --> |IN|AA[with]
  Z --> AB(noun_phrase)
  AB --> |NOUN|AC[disappointment]
  A --> |PUNCT|AD[.]
flowchart TD
  A[sentence]
  A --> B(independent_clause)
  B --> C(clause)
  C --> D(subject)
  D --> E(noun_phrase)
  E --> |NOUN|F[She]
  C --> G(predicate)
  G --> H(verb_phrase)
  H --> I(verb_phrase)
  I --> J(verb_phrase)
  J --> |VERB|K[pretends]
  I --> L(infinitive)
  L --> |TO|M[to]
  L --> N(adverb_phrase)
  N --> |ADV|O[not]
  L --> |VERB|P[want]
  H --> Q(noun_phrase)
  Q --> |DETERMINER|R[his]
  Q --> S(noun_phrase)
  S --> |NOUN|T[sandwich]
  A --> |PUNCT|U[.]
flowchart TD
  A[sentence]
  A --> B(independent_clause)
  B --> C(clause)
  C --> D(subject)
  D --> E(noun_phrase)
  E --> |NOUN|F[He]
  C --> G(predicate)
  G --> H(verb_phrase)
  H --> I(verb_phrase)
  I --> J(verb_phrase)
  J --> |VERB|K[forces]
  I --> L(noun_phrase)
  L --> |DETERMINER|M[her]
  L --> N(noun_phrase)
  N --> O(noun_phrase)
  O --> |NOUN|P[mouth]
  N --> Q(adjective_phrase)
  Q --> |ADJ|R[open]
  H --> |CCONJ|S[and]
  H --> T(verb_phrase)
  T --> U(verb_phrase)
  U --> |VERB|V[feeds]
  T --> W(noun_phrase)
  W --> |DETERMINER|X[his]
  W --> Y(noun_phrase)
  Y --> |NOUN|Z[sandwich]
  T --> AA(prepositional_phrase)
  AA --> |IN|AB[to]
  AA --> AC(noun_phrase)
  AC --> |NOUN|AD[her]
  A --> |PUNCT|AE[.]
flowchart TD
  A[sentence]
  A --> B(independent_clause)
  B --> C(clause)
  C --> D(subject)
  D --> E(noun_phrase)
  E --> F(adjective_phrase)
  F --> G(prepositional_phrase)
  G --> |IN|H[With]
  G --> I(noun_phrase)
  I --> |DETERMINER|J[a]
  I --> K(noun_phrase)
  K --> L(adjective_phrase)
  L --> |ADJ|M[lusty]
  K --> N(noun_phrase)
  N --> |NOUN|O[moan]
  N --> |PUNCT|P[,]
  E --> Q(noun_phrase)
  Q --> |NOUN|R[she]
  C --> S(predicate)
  S --> T(verb_phrase)
  T --> U(verb_phrase)
  U --> V(verb_phrase)
  V --> |VERB|W[finishes]
  U --> |VERB|X[eating]
  T --> Y(noun_phrase)
  Y --> |DETERMINER|Z[his]
  Y --> AA(noun_phrase)
  AA --> |NOUN|AB[sandwich]
  A --> |PUNCT|AC[.]
flowchart TD
  A[sentence]
  A --> B(independent_clause)
  B --> C(clause)
  C --> D(subject)
  D --> E(noun_phrase)
  E --> |NOUN|F[He]
  C --> G(predicate)
  G --> H(verb_phrase)
  H --> I(verb_phrase)
  I --> J(adverb_phrase)
  J --> |ADV|K[tenderly]
  I --> L(verb_phrase)
  L --> |VERB|M[cleans]
  H --> N(noun_phrase)
  N --> |DETERMINER|O[her]
  N --> P(noun_phrase)
  P --> |NOUN|Q[mouth]
  H --> R(prepositional_phrase)
  R --> |IN|S[for]
  R --> T(noun_phrase)
  T --> |NOUN|U[her]
  A --> |PUNCT|V[.]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment