Skip to content

Instantly share code, notes, and snippets.

@norio
Created November 26, 2010 17:37
Show Gist options
  • Save norio/716998 to your computer and use it in GitHub Desktop.
Save norio/716998 to your computer and use it in GitHub Desktop.
igo-python gae test
# -*- coding: utf-8 -*-
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
import igo.Tagger
class MainHandler(webapp.RequestHandler):
def get(self):
text = self.request.get('text', u'こんにちは世界')
t = igo.Tagger.Tagger('ipadic', True)
l = t.parse(text)
html = ""
for m in l:
html += "%s, %s, %s<br>" % (m.surface, m.feature, m.start)
self.response.out.write(html)
def main():
application = webapp.WSGIApplication([('/', MainHandler)],
debug=True)
util.run_wsgi_app(application)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment