Skip to content

Commit

Permalink
Merge pull request #66 from codemstrneel/patch-6
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
DrJJ committed Jul 25, 2024
2 parents a3b9dd4 + 7213422 commit b86dde7
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion grammars/generate/from-examples/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,37 @@
sample code to generate grammars froma list of examples
# Grammar Processor

==========================================

This is a library for creating grammars in [JJSGF](https://support.voicegain.ai/hc/en-us/articles/360048936511-JJSGF-Grammars) format from a set of sentences.


```python
sentences_to_jjsgf_grammar(sentences)
```

, where sentences is a python list, creates a JJSGF grammar from the sentences (near-shortest grammar).


__________
The following methods are used to process the grammar:

```python
generateBaseGrammar(sentences)
```

generates ABNF-style grammar from the sentences.

```python
get_jjsgf(grammar)
```
builds unprocessed JJSGF-formatted grammar from above ABNF.


```python
fix_jjsgf(jjsgf)
```

Takes JJSGF grammar and optimizes by removing repeated rules and combining where possible iteratively.



0 comments on commit b86dde7

Please sign in to comment.