#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division
import codecs
from nltk import parse_cfg
from nltk import word_tokenize
from nltk import RecursiveDescentParser


def encode(string, char_type='utf8', errors=''):
    return codecs.encode(string, char_type, errors)

cfg = encode("""
S -> NP VP NP | NP VP
NP -> 'Péter' | 'Marit' | e
VP -> 'szereti' | e
""")

parsed_cfg = parse_cfg(cfg)

parser = RecursiveDescentParser(parsed_cfg)
uni_text = encode('Péter szereti Marit')
sentence = word_tokenize(uni_text)

print parser.parse(sentence)
@@ -335,16 +335,8 @@
 P NP
- %7C NP VP
 %0ANP 
@@ -536,16 +536,137 @@
 _text)%0A%0A
+parser = RecursiveDescentParser(parsed_cfg)%0Auni_text = encode('P%C3%A9ter szereti Marit')%0Asentence = word_tokenize(uni_text)%0A%0A
 print pa

Add CFG parser examples