1# vim:fileencoding=utf-8
2#
3# greetingInGreek.py
4#
5# Demonstration of the parsing module, on the prototypical "Hello, World!" example
6#
7# Copyright 2004-2016, by Paul McGuire
8#
9from pyparsing import Word, pyparsing_unicode as ppu
10
11# define grammar
12alphas = ppu.Greek.alphas
13greet = Word(alphas) + ',' + Word(alphas) + '!'
14
15# input string
16hello = "Καλημέρα, κόσμε!"
17
18# parse input string
19print(greet.parseString(hello))
20