{"action":"created","issue":{"url":"https://api.github.com/repos/rime/librime/issues/90","repository_url":"https://api.github.com/repos/rime/librime","labels_url":"https://api.github.com/repos/rime/librime/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/rime/librime/issues/90/comments","events_url":"https://api.github.com/repos/rime/librime/issues/90/events","html_url":"https://github.com/rime/librime/issues/90","id":162720344,"number":90,"title":"如何进行输入统计？","user":{"login":"Axure","id":3424317,"avatar_url":"https://avatars.githubusercontent.com/u/3424317?v=3","gravatar_id":"","url":"https://api.github.com/users/Axure","html_url":"https://github.com/Axure","followers_url":"https://api.github.com/users/Axure/followers","following_url":"https://api.github.com/users/Axure/following{/other_user}","gists_url":"https://api.github.com/users/Axure/gists{/gist_id}","starred_url":"https://api.github.com/users/Axure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Axure/subscriptions","organizations_url":"https://api.github.com/users/Axure/orgs","repos_url":"https://api.github.com/users/Axure/repos","events_url":"https://api.github.com/users/Axure/events{/privacy}","received_events_url":"https://api.github.com/users/Axure/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-28T15:49:25Z","updated_at":"2016-07-01T06:53:51Z","closed_at":null,"body":"如果我要进行这方面的开发，应该从哪里入手呢？"},"comment":{"url":"https://api.github.com/repos/rime/librime/issues/comments/229868833","html_url":"https://github.com/rime/librime/issues/90#issuecomment-229868833","issue_url":"https://api.github.com/repos/rime/librime/issues/90","id":229868833,"user":{"login":"lotem","id":151157,"avatar_url":"https://avatars.githubusercontent.com/u/151157?v=3","gravatar_id":"","url":"https://api.github.com/users/lotem","html_url":"https://github.com/lotem","followers_url":"https://api.github.com/users/lotem/followers","following_url":"https://api.github.com/users/lotem/following{/other_user}","gists_url":"https://api.github.com/users/lotem/gists{/gist_id}","starred_url":"https://api.github.com/users/lotem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lotem/subscriptions","organizations_url":"https://api.github.com/users/lotem/orgs","repos_url":"https://api.github.com/users/lotem/repos","events_url":"https://api.github.com/users/lotem/events{/privacy}","received_events_url":"https://api.github.com/users/lotem/received_events","type":"User","site_admin":false},"created_at":"2016-07-01T06:53:51Z","updated_at":"2016-07-01T06:53:51Z","body":"第一步是確定需求吧。有一些是可以從用戶詞典裏挖掘的，但是想要更多信息和更精細的控制，肯定要切入到輸入法引擎的內部。\r\n\r\n`Engine` 大致就是所謂「輸入法引擎」。處理按鍵導致一系列內部狀態更新的事件，引擎監聽這些事件並完成相應的動作，如輸入碼變化則重新轉換，又如選詞、上屏、輸入法開關狀態變化等。\r\nhttps://github.com/rime/librime/blob/develop/src/engine.cc#L71\r\n\r\n需要寫一個用作統計的組件，在 `Engine` 加載時預先加載爲 `processor`，但他並不響應任何按鍵，只是監聽以上各種事件，完成統計。\r\nhttps://github.com/rime/librime/blob/develop/src/engine.cc#L287\r\n\r\n現在 librime 公開的 API 並沒有暴露很多內部的實現。雖然支持寫插件（以動態鏈接庫形式提供新的組件定義），但尚不能暗中把某個輸入方案中未指明的組件注入到引擎，所以要動一動源碼。"}}
{"actor":{"display_login":"lotem"}}