Skip to content

Instantly share code, notes, and snippets.

@mohemohe
Created October 15, 2015 05:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohemohe/1c4f5af64847e1b08111 to your computer and use it in GitHub Desktop.
Save mohemohe/1c4f5af64847e1b08111 to your computer and use it in GitHub Desktop.
ATOKダイレクトAPIで柔軟に「いま」できるやつ
#! /usr/bin/env python
# coding:utf-8
import datetime
def atok_plugin_run_process( request_data ):
result_data = {}
candidate_array = []
now = datetime.datetime.now()
IMA = '{0:%Y-%m-%d %H:%M:%S}'.format(now)
if request_data['composition_string'] == u'いま':
candidate_array.append({'hyoki': IMA.decode('utf-8')})
result_data['candidate'] = candidate_array
return result_data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment