2023-08-27 16:23:49 +00:00
|
|
|
definitions:
|
2024-04-14 13:11:18 +00:00
|
|
|
libmozhi.ImgOut:
|
|
|
|
properties:
|
|
|
|
sourceB64:
|
|
|
|
type: string
|
|
|
|
sourceLang:
|
|
|
|
type: string
|
|
|
|
sourceTextParsed:
|
|
|
|
type: string
|
|
|
|
targetLang:
|
|
|
|
type: string
|
|
|
|
translatedImgB64:
|
|
|
|
type: string
|
|
|
|
translatedTextParsed:
|
|
|
|
type: string
|
|
|
|
type: object
|
2023-09-11 03:45:41 +00:00
|
|
|
libmozhi.LangOut:
|
2023-08-27 16:23:49 +00:00
|
|
|
properties:
|
|
|
|
detected:
|
|
|
|
type: string
|
|
|
|
engine:
|
|
|
|
type: string
|
2024-07-20 10:08:23 +00:00
|
|
|
source_antonyms:
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
type: array
|
|
|
|
source_equivalent_target_lang:
|
|
|
|
additionalProperties:
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
type: array
|
|
|
|
type: object
|
2023-08-27 16:23:49 +00:00
|
|
|
source_language:
|
|
|
|
type: string
|
2024-07-20 10:08:23 +00:00
|
|
|
source_synonyms:
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
type: array
|
2024-04-14 13:11:18 +00:00
|
|
|
source_transliteration:
|
|
|
|
type: string
|
2024-07-20 10:08:23 +00:00
|
|
|
target_antonyms:
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
type: array
|
|
|
|
target_equivalent_source_lang:
|
|
|
|
additionalProperties:
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
type: array
|
|
|
|
type: object
|
2023-08-27 16:23:49 +00:00
|
|
|
target_language:
|
|
|
|
type: string
|
2024-07-20 10:08:23 +00:00
|
|
|
target_synonyms:
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
type: array
|
2024-04-14 13:11:18 +00:00
|
|
|
target_transliteration:
|
|
|
|
type: string
|
2023-08-27 16:23:49 +00:00
|
|
|
translated-text:
|
|
|
|
type: string
|
2023-11-12 06:18:52 +00:00
|
|
|
word_choices:
|
|
|
|
items:
|
|
|
|
$ref: '#/definitions/libmozhi.WordChoices'
|
|
|
|
type: array
|
2023-08-27 16:23:49 +00:00
|
|
|
type: object
|
2023-09-11 03:45:41 +00:00
|
|
|
libmozhi.List:
|
2023-08-27 16:23:49 +00:00
|
|
|
properties:
|
|
|
|
id:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
type: object
|
2023-11-12 06:18:52 +00:00
|
|
|
libmozhi.WordChoices:
|
|
|
|
properties:
|
2024-07-20 10:08:23 +00:00
|
|
|
definition:
|
|
|
|
type: string
|
|
|
|
example:
|
|
|
|
description: Example is for google alone; since it does not have a linked
|
|
|
|
example for source & target
|
|
|
|
type: string
|
2023-11-12 06:18:52 +00:00
|
|
|
examples_source:
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
type: array
|
|
|
|
examples_target:
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
type: array
|
|
|
|
word:
|
|
|
|
type: string
|
|
|
|
type: object
|
2023-08-27 16:23:49 +00:00
|
|
|
info:
|
|
|
|
contact: {}
|
|
|
|
paths:
|
2023-10-25 13:09:31 +00:00
|
|
|
/api/engines:
|
|
|
|
get:
|
|
|
|
description: Lists available Engines.
|
|
|
|
responses:
|
|
|
|
"200":
|
|
|
|
description: OK
|
|
|
|
schema:
|
|
|
|
additionalProperties:
|
|
|
|
type: string
|
|
|
|
type: object
|
|
|
|
summary: List engines
|
2024-04-14 13:11:18 +00:00
|
|
|
/api/image:
|
|
|
|
post:
|
|
|
|
description: When engine is set to all, it will return an array of libmozhi.LangOut.
|
|
|
|
parameters:
|
|
|
|
- description: Engine name
|
2024-07-20 10:08:23 +00:00
|
|
|
in: formData
|
2024-04-14 13:11:18 +00:00
|
|
|
name: engine
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
- description: Source language
|
2024-07-20 10:08:23 +00:00
|
|
|
in: formData
|
2024-04-14 13:11:18 +00:00
|
|
|
name: from
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
- description: Target language
|
2024-07-20 10:08:23 +00:00
|
|
|
in: formData
|
2024-04-14 13:11:18 +00:00
|
|
|
name: to
|
|
|
|
required: true
|
|
|
|
type: string
|
2024-07-20 10:08:23 +00:00
|
|
|
- description: PNG image
|
|
|
|
in: formData
|
2024-04-14 13:11:18 +00:00
|
|
|
name: image
|
|
|
|
required: true
|
2024-07-20 10:08:23 +00:00
|
|
|
type: file
|
2024-04-14 13:11:18 +00:00
|
|
|
responses:
|
|
|
|
"200":
|
|
|
|
description: OK
|
|
|
|
schema:
|
|
|
|
$ref: '#/definitions/libmozhi.ImgOut'
|
|
|
|
summary: Translate an image
|
2023-08-27 16:23:49 +00:00
|
|
|
/api/source_languages:
|
|
|
|
get:
|
|
|
|
parameters:
|
|
|
|
- description: Engine name
|
|
|
|
in: query
|
|
|
|
name: engine
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
responses:
|
|
|
|
"200":
|
2023-09-11 03:45:41 +00:00
|
|
|
description: OK
|
2023-08-27 16:23:49 +00:00
|
|
|
schema:
|
2023-09-11 03:45:41 +00:00
|
|
|
$ref: '#/definitions/libmozhi.List'
|
2023-08-27 16:23:49 +00:00
|
|
|
summary: Show list of available source languages for engine
|
|
|
|
/api/target_languages:
|
|
|
|
get:
|
|
|
|
parameters:
|
|
|
|
- description: Engine name
|
|
|
|
in: query
|
|
|
|
name: engine
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
responses:
|
|
|
|
"200":
|
2023-09-11 03:45:41 +00:00
|
|
|
description: OK
|
2023-08-27 16:23:49 +00:00
|
|
|
schema:
|
2023-09-11 03:45:41 +00:00
|
|
|
$ref: '#/definitions/libmozhi.List'
|
2023-08-27 16:23:49 +00:00
|
|
|
summary: Show list of available target languages for engine
|
|
|
|
/api/translate:
|
|
|
|
get:
|
2023-09-09 14:33:14 +00:00
|
|
|
description: When engine is set to all, it will return an array of libmozhi.LangOut.
|
2023-08-27 16:23:49 +00:00
|
|
|
parameters:
|
|
|
|
- description: Engine name
|
|
|
|
in: query
|
|
|
|
name: engine
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
- description: Source language
|
|
|
|
in: query
|
|
|
|
name: from
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
- description: Target language
|
|
|
|
in: query
|
|
|
|
name: to
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
- description: Text being translated
|
|
|
|
in: query
|
|
|
|
name: text
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
responses:
|
|
|
|
"200":
|
2023-09-11 03:45:41 +00:00
|
|
|
description: OK
|
2023-08-27 16:23:49 +00:00
|
|
|
schema:
|
2023-09-11 03:45:41 +00:00
|
|
|
$ref: '#/definitions/libmozhi.LangOut'
|
2023-08-27 16:23:49 +00:00
|
|
|
summary: Translate text
|
|
|
|
/api/tts:
|
|
|
|
get:
|
|
|
|
parameters:
|
|
|
|
- description: Engine name
|
|
|
|
in: query
|
|
|
|
name: engine
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
- description: Language being TTS'd
|
|
|
|
in: query
|
|
|
|
name: lang
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
- description: Text being TTS'd
|
|
|
|
in: query
|
|
|
|
name: text
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
responses: {}
|
|
|
|
summary: Get Text-To-Speech for specified language using specified engine
|
|
|
|
swagger: "2.0"
|