how did i forget to comment my testing stuff
Some checks failed
mozhi pipeline / Push Docker image to Codeberg docker registry (push) Failing after 20m26s
mozhi pipeline / Build and publish artifacts (push) Failing after 11m24s

This commit is contained in:
Arya 2024-07-20 15:38:23 +05:30
parent c233475390
commit aad4b83079
Signed by: arya
GPG Key ID: 842D12BDA50DF120
4 changed files with 151 additions and 19 deletions

View File

@ -41,28 +41,28 @@ const docTemplate = `{
"type": "string", "type": "string",
"description": "Engine name", "description": "Engine name",
"name": "engine", "name": "engine",
"in": "query", "in": "formData",
"required": true "required": true
}, },
{ {
"type": "string", "type": "string",
"description": "Source language", "description": "Source language",
"name": "from", "name": "from",
"in": "query", "in": "formData",
"required": true "required": true
}, },
{ {
"type": "string", "type": "string",
"description": "Target language", "description": "Target language",
"name": "to", "name": "to",
"in": "query", "in": "formData",
"required": true "required": true
}, },
{ {
"type": "string", "type": "file",
"description": "PNG image in base64 format", "description": "PNG image",
"name": "image", "name": "image",
"in": "query", "in": "formData",
"required": true "required": true
} }
], ],
@ -227,15 +227,57 @@ const docTemplate = `{
"engine": { "engine": {
"type": "string" "type": "string"
}, },
"source_antonyms": {
"type": "array",
"items": {
"type": "string"
}
},
"source_equivalent_target_lang": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"source_language": { "source_language": {
"type": "string" "type": "string"
}, },
"source_synonyms": {
"type": "array",
"items": {
"type": "string"
}
},
"source_transliteration": { "source_transliteration": {
"type": "string" "type": "string"
}, },
"target_antonyms": {
"type": "array",
"items": {
"type": "string"
}
},
"target_equivalent_source_lang": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"target_language": { "target_language": {
"type": "string" "type": "string"
}, },
"target_synonyms": {
"type": "array",
"items": {
"type": "string"
}
},
"target_transliteration": { "target_transliteration": {
"type": "string" "type": "string"
}, },
@ -264,6 +306,13 @@ const docTemplate = `{
"libmozhi.WordChoices": { "libmozhi.WordChoices": {
"type": "object", "type": "object",
"properties": { "properties": {
"definition": {
"type": "string"
},
"example": {
"description": "Example is for google alone; since it does not have a linked example for source \u0026 target",
"type": "string"
},
"examples_source": { "examples_source": {
"type": "array", "type": "array",
"items": { "items": {

View File

@ -30,28 +30,28 @@
"type": "string", "type": "string",
"description": "Engine name", "description": "Engine name",
"name": "engine", "name": "engine",
"in": "query", "in": "formData",
"required": true "required": true
}, },
{ {
"type": "string", "type": "string",
"description": "Source language", "description": "Source language",
"name": "from", "name": "from",
"in": "query", "in": "formData",
"required": true "required": true
}, },
{ {
"type": "string", "type": "string",
"description": "Target language", "description": "Target language",
"name": "to", "name": "to",
"in": "query", "in": "formData",
"required": true "required": true
}, },
{ {
"type": "string", "type": "file",
"description": "PNG image in base64 format", "description": "PNG image",
"name": "image", "name": "image",
"in": "query", "in": "formData",
"required": true "required": true
} }
], ],
@ -216,15 +216,57 @@
"engine": { "engine": {
"type": "string" "type": "string"
}, },
"source_antonyms": {
"type": "array",
"items": {
"type": "string"
}
},
"source_equivalent_target_lang": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"source_language": { "source_language": {
"type": "string" "type": "string"
}, },
"source_synonyms": {
"type": "array",
"items": {
"type": "string"
}
},
"source_transliteration": { "source_transliteration": {
"type": "string" "type": "string"
}, },
"target_antonyms": {
"type": "array",
"items": {
"type": "string"
}
},
"target_equivalent_source_lang": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"target_language": { "target_language": {
"type": "string" "type": "string"
}, },
"target_synonyms": {
"type": "array",
"items": {
"type": "string"
}
},
"target_transliteration": { "target_transliteration": {
"type": "string" "type": "string"
}, },
@ -253,6 +295,13 @@
"libmozhi.WordChoices": { "libmozhi.WordChoices": {
"type": "object", "type": "object",
"properties": { "properties": {
"definition": {
"type": "string"
},
"example": {
"description": "Example is for google alone; since it does not have a linked example for source \u0026 target",
"type": "string"
},
"examples_source": { "examples_source": {
"type": "array", "type": "array",
"items": { "items": {

View File

@ -20,12 +20,40 @@ definitions:
type: string type: string
engine: engine:
type: string type: string
source_antonyms:
items:
type: string
type: array
source_equivalent_target_lang:
additionalProperties:
items:
type: string
type: array
type: object
source_language: source_language:
type: string type: string
source_synonyms:
items:
type: string
type: array
source_transliteration: source_transliteration:
type: string type: string
target_antonyms:
items:
type: string
type: array
target_equivalent_source_lang:
additionalProperties:
items:
type: string
type: array
type: object
target_language: target_language:
type: string type: string
target_synonyms:
items:
type: string
type: array
target_transliteration: target_transliteration:
type: string type: string
translated-text: translated-text:
@ -44,6 +72,12 @@ definitions:
type: object type: object
libmozhi.WordChoices: libmozhi.WordChoices:
properties: properties:
definition:
type: string
example:
description: Example is for google alone; since it does not have a linked
example for source & target
type: string
examples_source: examples_source:
items: items:
type: string type: string
@ -74,25 +108,25 @@ paths:
description: When engine is set to all, it will return an array of libmozhi.LangOut. description: When engine is set to all, it will return an array of libmozhi.LangOut.
parameters: parameters:
- description: Engine name - description: Engine name
in: query in: formData
name: engine name: engine
required: true required: true
type: string type: string
- description: Source language - description: Source language
in: query in: formData
name: from name: from
required: true required: true
type: string type: string
- description: Target language - description: Target language
in: query in: formData
name: to name: to
required: true required: true
type: string type: string
- description: PNG image in base64 format - description: PNG image
in: query in: formData
name: image name: image
required: true required: true
type: string type: file
responses: responses:
"200": "200":
description: OK description: OK

2
go.mod
View File

@ -4,7 +4,7 @@ go 1.21.0
replace github.com/OwO-Network/gdeeplx => github.com/gi-yt/gdeeplx v0.0.0-20230817133036-0eb71706cd51 replace github.com/OwO-Network/gdeeplx => github.com/gi-yt/gdeeplx v0.0.0-20230817133036-0eb71706cd51
replace codeberg.org/aryak/libmozhi => /home/arya/projects/mozhi/libmozhi //replace codeberg.org/aryak/libmozhi => /home/arya/projects/mozhi/libmozhi
require ( require (
codeberg.org/aryak/libmozhi v0.0.0-20240717101951-60801036fad6 codeberg.org/aryak/libmozhi v0.0.0-20240717101951-60801036fad6