<commit_before># bnf

[![Build Status](https://travis-ci.org/snewt/bnf.svg?branch=master)](https://travis-ci.org/snewt/bnf)
[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Crates.io Version](https://img.shields.io/crates/v/bnf.svg)](https://crates.io/crates/bnf)

A library for parsing Backus–Naur form context-free grammars
inspired by the JavaScript library [prettybnf](https://github.com/dhconnelly/prettybnf)

## What does a parsable BNF grammar look like?

The following grammar from the [Wikipedia page on Backus-Naur form](https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form#Example)
is exemplifies a compatible grammar after adding ';' characters to indicate the end of a producion.

```text
<postal-address> ::= <name-part> <street-address> <zip-part>;

        <name-part> ::= <personal-part> <last-name> <opt-suffix-part> <EOL>
                    | <personal-part> <name-part>;

    <personal-part> ::= <initial> "." | <first-name>;

    <street-address> ::= <house-num> <street-name> <opt-apt-num> <EOL>;

        <zip-part> ::= <town-name> "," <state-code> <ZIP-code> <EOL>;

<opt-suffix-part> ::= "Sr." | "Jr." | <roman-numeral> | "";
    <opt-apt-num> ::= <apt-num> | "";
```
<commit_msg>minor documentation fix, removed an extra 'is' and specified a ';' for 'every' rather than just 'a' production<commit_after># bnf

[![Build Status](https://travis-ci.org/snewt/bnf.svg?branch=master)](https://travis-ci.org/snewt/bnf)
[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Crates.io Version](https://img.shields.io/crates/v/bnf.svg)](https://crates.io/crates/bnf)

A library for parsing Backus–Naur form context-free grammars
inspired by the JavaScript library [prettybnf](https://github.com/dhconnelly/prettybnf)

## What does a parsable BNF grammar look like?

The following grammar from the [Wikipedia page on Backus-Naur form](https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form#Example)
exemplifies a compatible grammar after adding ';' characters to indicate the end of each producion.

```text
<postal-address> ::= <name-part> <street-address> <zip-part>;

        <name-part> ::= <personal-part> <last-name> <opt-suffix-part> <EOL>
                    | <personal-part> <name-part>;

    <personal-part> ::= <initial> "." | <first-name>;

    <street-address> ::= <house-num> <street-name> <opt-apt-num> <EOL>;

        <zip-part> ::= <town-name> "," <state-code> <ZIP-code> <EOL>;

<opt-suffix-part> ::= "Sr." | "Jr." | <roman-numeral> | "";
    <opt-apt-num> ::= <apt-num> | "";
```

{'fraction_non_alphanumeric': 0.1978963770938839, 'fraction_numerical': 0.0038955979742890533, 'mean_word_length': 4.085148514851485, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 59, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2668086', 'n_tokens_mistral': 990, 'n_tokens_neox': 928, 'n_words': 185}