blob: 979a5644ad096d2c391012911df402d8aa654211 [file] [log] [blame]
Joe Gregorio35139022010-11-04 19:37:43 -04001#!/usr/bin/python2.4
2# -*- coding: utf-8 -*-
3#
4# Copyright 2010 Google Inc. All Rights Reserved.
5
Joe Gregoriof17cbd32010-11-04 19:40:45 -04006"""Simple command-line example for Diacritize.
Joe Gregorio35139022010-11-04 19:37:43 -04007
Joe Gregoriof17cbd32010-11-04 19:40:45 -04008Command-line application that adds diacritical
9marks to some text.
Joe Gregorio35139022010-11-04 19:37:43 -040010"""
11
12__author__ = 'jcgregorio@google.com (Joe Gregorio)'
13
14from apiclient.discovery import build
15
16import httplib2
17import pickle
18import pprint
19
20# Uncomment the next line to get very detailed logging
21# httplib2.debuglevel = 4
22
Joe Gregorio35139022010-11-04 19:37:43 -040023
Joe Gregorioaf276d22010-12-09 14:26:58 -050024def main():
Joe Gregorio1ae3e742011-02-25 15:17:14 -050025 service = build("diacritize", "v1",
Joe Gregorioaf276d22010-12-09 14:26:58 -050026 developerKey="AIzaSyDRRpR3GS1F1_jKNNM9HCNd2wJQyPG3oN0")
Joe Gregorio1ae3e742011-02-25 15:17:14 -050027 print service.diacritize().corpus().get(
Joe Gregorio35139022010-11-04 19:37:43 -040028 lang='ar',
29 last_letter='false',
30 message=u'مثال لتشكيل'
31 ).execute()['diacritized_text']
32
33if __name__ == '__main__':
34 main()