swagger: "2.0" info: description: "AI Squared Tokenizer API server" version: "1.4.0" title: "AI Squared Tokenizer API server" contact: email: "ota@ai2-jp.com" license: name: "Private" host: "tokenizer-test.platform.ai2-jp.com" # host: "localhost:8083" basePath: "/v1" tags: - name: "tokenize" description: "Tokenize API Endpoint" - name: "system-dicts" description: "システム辞書" - name: "user-dicts" description: "ユーザ辞書" - name: "elements" description: "Token Element Definition" schemes: - "https" - "http" paths: /tokenize: post: tags: - "tokenize" summary: "Tokenize" description: "" operationId: "tokenize" produces: - "application/json" parameters: - name: body in: body required: true description: "分かち書きリクエスト。対応する要素は将来的に増える可能性があるので、必要な要素を常に配列で指定して使用すること" schema: $ref: "#/definitions/TokenizeRequest" responses: 200: description: "成功" schema: type: "array" items: $ref: "#/definitions/TokenizeResult" 400: description: "入力エラー" schema: $ref: "#/definitions/Error" 500: description: "内部エラー" schema: $ref: "#/definitions/Error" /system-dicts: get: tags: - "system-dicts" summary: "システム辞書の一覧を取得する" description: "" operationId: "getSystemDicts" produces: - "application/json" responses: 200: description: "successful operation" schema: type: "array" items: $ref: "#/definitions/SystemDictionaryDetail" 500: description: "Internal Error" /user-dicts: post: tags: - "user-dicts" summary: "ユーザ辞書を登録する" description: "ユーザ辞書はサーバから予告なく削除される可能性がある。ユーザ辞書がサーバ側で見つからない場合には、再度登録を行うこと。辞書の登録内容にはシステム辞書に応じた正規化が自動的に適用される" produces: - "application/json" parameters: - name: body in: body required: true description: "ユーザ辞書定義" schema: $ref: "#/definitions/UserDictionaryDetail" responses: 200: description: "successful operation" schema: type: "object" properties: userDictId: $ref: "#/definitions/UserDictionaryId" 400: description: "入力エラー" schema: type: "object" properties: userDictId: $ref: "#/definitions/UserDictionaryId" error: $ref: "#/definitions/Error" 500: description: "Internal Error" /elements: get: tags: - "elements" summary: "List all Elements" description: "" operationId: "getElements" produces: - "application/json" responses: 200: description: "successful operation" schema: type: "array" items: $ref: "#/definitions/ElementDetail" 500: description: "Internal Error" definitions: SystemDictionaryId: type: "string" enum: - "IPADIC" - "IPADIC_NEOLOGD" - "UNIDIC" - "UNIDIC_NEOLOGD" SystemDictionaryDetail: type: "object" properties: id: $ref: "#/definitions/SystemDictionaryId" description: type: "string" example: "IPA Dictionary + some modification" UserDictionaryId: type: "string" default: "" UserDictionaryDetail: type: "object" properties: definitions: type: "array" items: type: "object" properties: representation: type: "string" example: "コーヒー" synonyms: type: "array" items: type: "string" example: ["coffee", "covfefe"] references: type: "array" items: type: "string" example: ["コーヒー", "珈琲"] ElementType: type: "string" enum: - "SURFACEFORM" - "RCATTR" - "LCATTR" - "STAT" - "WCOST" - "COST" - "PARTOFSPEECH" - "PARTOFSPEECH1" - "PARTOFSPEECH2" - "PARTOFSPEECH3" - "PARTOFSPEECH4" - "CONJUGATEDFORM" - "INFLECTION" - "BASEFORM" - "UNINFLECTEDREPRESENTATION" - "PRONUNCIATION" - "INFLECTEDREPRESENTATION" - "UNINFLECTEDPRONUNCIATION" - "RAW" ElementDetail: type: "object" properties: id: $ref: "#/definitions/ElementType" description: type: "string" example: "IPA Dictionary + some modification" TokenizeOption: type: "object" properties: user-dict: required: false default: "" $ref: "#/definitions/UserDictionaryId" system-dict: $ref: "#/definitions/SystemDictionaryId" elements: type: "array" items: $ref: "#/definitions/ElementType" normalizers: type: "array" items: $ref: "#/definitions/NormalizerType" TokenizeRequest: type: "object" properties: options: type: "array" items: $ref: "#/definitions/TokenizeOption" texts: type: "array" items: type: "string" example: "ここに分かち書きしたい文字列を入れる" TokenizeResult: type: "array" items: type: "object" properties: option: $ref: "#/definitions/TokenizeOption" outputs: type: "array" items: $ref: "#/definitions/Tokens" Token: type: "string" example: "分かち書きされたトークン" Tokens: type: "array" items: $ref: "#/definitions/Token" NormalizerType: type: "string" enum: - "IPADIC" - "UNIDIC" - "NEOLOGD" - "NEOLOGD_CUSTOM1" description: > Normalizer Type: * `IPADIC` - Same as IPADIC spec * `UNIDIC` - Same as UNIDIC spec * `NEOLOGD` - Same as NEOLOG spec * `NEOLOGD_CUSTOM1` - NEOLOGDの単語間スペース除去以外を適用 ErrorCode: type: "string" enum: - "I001" - "I002" - "I003" - "I004" - "I005" - "I006" - "I007" - "I008" - "I009" - "I010" description: > Error Code: * `I001` - options are required * `I002` - texts are required * `I003` - system-dict is required in each option * `I004` - elements are required in each option * `I005` - unknown element * `I006` - unknown normalizer * `I007` - User Dict Not Found * `I008` - invalid reference * `I009` - duplicate synonym * `I010` - synonym registration error Error: type: "object" properties: code: $ref: "#/definitions/ErrorCode" description: type: "string" example: "エラー詳細" description: "可読性向上のためのもので、予告なく変更される可能性がある" externalDocs: description: "Find out more about Swagger" url: "http://swagger.io"