(linenum→info "unix/slp.c:2238")

anthy/9100e/doc/protocol.txt

    1: EGG との通信のプロトコル
    2:  anthy-agentコマンドに--eggオプションを設定して起動することで利用可能です。
    3: 
    4: 挨拶
    5:         greeting = server-name " (" version ") " options " :" string CRLF
    6:         server-name = string
    7:         version = 1*(DIGIT)
    8:         options = "[" string 1*(", " string ) "]"
    9: 
   10: Command Semantics and Syntax
   11: 
   12:         context-desc = 1*( DIGIT)
   13:                 ; context descriptor
   14: 
   15:         seg-no  = 1*(DIGIT)
   16:                 ; segment number (0 origin)
   17: 
   18:         candidate-offset = 1*(DIGIT)
   19: 
   20:         max-candidates = 1*(DIGIT)
   21: 
   22:         cand-no = 1*(DIGIT)
   23:                 ; candidate number (0 origin)
   24: 
   25:         string = 1*<any CHAR excluding control characters>
   26: 
   27:         error = "-ERR" SP error-code SP string CRLF
   28: 
   29:         error-code = 1*( DIGIT )
   30: 
   31:         success-with-number = "+OK" SP number CRLF
   32: 
   33:         number = 1*( DIGIT )
   34: 
   35:         success = "+OK" CRLF
   36: 
   37:         segments = "+DATA" SP seg-no SP number-of-segments-removed SP
   38:                    number-of-segments-inserted CRLF
   39:                    1*( number-of-candidates SP converted SP yomi CRLF )
   40:                    CRLF
   41: 
   42:         number-of-replaced = 1*( DIGIT )
   43: 
   44:         offset = 1*( DIGIT )
   45: 
   46:         number-of-segments = 1*( DIGIT )
   47: 
   48:         converted = string
   49: 
   50:         yomi = string
   51: 
   52:         candidates = "+DATA" SP offset SP number-of-candidates CRLF
   53:                    1*( converted CRLF )
   54:                    CRLF
   55: 
   56:         number-of-candidates = 1*( DIGIT )
   57: 
   58: 
   59: 1. コンテクスト生成
   60:   Command:
   61:         command-new-context = "NEW-CONTEXT" parameters CRLF
   62:         parameters = *( SP expression )
   63:                    ; e.g. : Encoding specification, etc.
   64:         expression = var "=" value
   65:         var = 1*(ALPHA) 1*(ALPHA / DIGIT)
   66:         value = string
   67:                    ; INPUT=UTF-8 OUTPUT=UTF-8
   68:                    ; INPUT=#106 OUTPUT=#106
   69:                    ; INPUT=EUC-JP OUTPUT=EUC-JP
   70:                    ; INPUT=#18 OUTPUT=#18
   71: 
   72:   Reply:
   73:         reply-of-new-context = error
   74:                              / success-with-number
   75:                              ; number: context-descriptor
   76: 
   77: 2. コンテクスト解放
   78:   Command:
   79:         command-release-context = "RELEASE-CONTEXT" SP context-desc CRLF
   80: 
   81:   Reply:
   82:         reply-of-release-context = error / success
   83: 
   84: 3. 変換
   85:   Command:
   86:         command-convert = "CONVERT" SP context-desc SP input CRLF
   87:         input = string
   88: 
   89:   Reply:
   90:         reply-of-convert = error / segments
   91: 
   92: 4. 変換結果コミット/キャンセル
   93:   Command:
   94:         command-commit-or-cancel = "COMMIT" SP context-desc SP do-cancel CRLF
   95:         do-cancel = "0" / "1"
   96:                   ;  0 のとき確定。その他のときキャンセル。
   97:   Reply:
   98:         reply-of-commit-or-cancel = error / success
   99: 
  100: 5.候補取得
  101:   Command:
  102:         command-get-candidates = "GET-CANDIDATES" SP context-desc SP
  103:                                   seg-no SP candidate-offset SP
  104:                                   max-candidates CRLF
  105: 
  106:   Reply:
  107:         reply-of-get-candidates = error / candidates
  108: 
  109: 6. 候補確定
  110:   Command:
  111:         command-select-candidate = "SELECT-CANDIDATE" SP context-desc SP
  112:                                    seg-no SP cand-no CRLF
  113:   Reply:
  114:         reply-of-select-candidate = error / success / segments
  115: 
  116: 7. 文節伸縮
  117:   Command:
  118:         command-resize-segment = "RESIZE-SEGMENT" SP context-desc SP
  119:                                   seg-no SP inc-dec CRLF
  120:         inc-dec = "0" / "1"
  121:                 ; "0" means increment, while "1" means decrement
  122:   Reply:
  123:         reply-of-resize-segment = error / segments
  124: 
  125: 8. 終了
  126:   Command:
  127:         command-quit = "QUIT" CRLF
  128:   Reply:
  129:         no reply, connection will be closed by server.
  130: -- 
Syntax (Markdown)