title: NLTK Context Free Grammar Genaration
body: <p>I'm working on a non-English parser with Unicode characters. For that, I decided to use NLTK.</p>
  
  <p>But it requires a predefined context-free grammar as below: </p>
  
  <pre><code>  S -&gt; NP VP
    VP -&gt; V NP | V NP PP
    PP -&gt; P NP
    V -&gt; "saw" | "ate" | "walked"
    NP -&gt; "John" | "Mary" | "Bob" | Det N | Det N PP
    Det -&gt; "a" | "an" | "the" | "my"
    N -&gt; "man" | "dog" | "cat" | "telescope" | "park"
    P -&gt; "in" | "on" | "by" | "with" 
  </code></pre>
  
  <p>In my app, I am supposed to minimize hard coding with the use of a rule-based grammar. 
  For example, I can assume any word ending with <strong>-ed</strong> or <strong>-ing</strong> as a verb. So it should work for any given context.</p>
  
  <p>How can I feed such grammar rules to NLTK? Or generate them dynamically using Finite State Machine?</p>