Created
November 26, 2010 17:37
-
-
Save norio/716998 to your computer and use it in GitHub Desktop.
igo-python gae test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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