diff --git a/terms-extraction/examples.http b/terms-extraction/examples.http index 126c983..f5d3361 100644 --- a/terms-extraction/examples.http +++ b/terms-extraction/examples.http @@ -31,3 +31,19 @@ } ] ### + +# Normalisation des termes de deux textes +POST https://terms-extraction.services.inist.fr/v1/tools/normalize?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { + "value": "Les dinosaures, de leur nom scientifique Dinosauria (du grec ancien deinόs « terrible » et saûros « lézard »), forment un super-ordre ainsi qu'un clade extrêmement diversifié de sauropsides de la sous-classe des diapsides et dont les uniques représentants actuels sont les oiseaux", + "id": "https://fr.wikipedia.org/wiki/Dinosauria" + }, + { + "value": "Café de Côte d'Ivoire", + "id": 1 + } +] +### diff --git a/terms-extraction/v1/tools/normalize.ini b/terms-extraction/v1/tools/normalize.ini new file mode 100644 index 0000000..e584fb8 --- /dev/null +++ b/terms-extraction/v1/tools/normalize.ini @@ -0,0 +1,35 @@ +# OpenAPI Documentation - JSON format (dot notation) +mimeType = application/json + +post.operationId = post-v1-tools +post.requestBody.content.application/json.example.0.id = 1 +post.requestBody.content.application/json.example.0.value = café ! +post.requestBody.content.application/json.example.1.id = 2 +post.requestBody.content.application/json.example.1.value = Côte d'Ivoire +post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream +post.requestBody.required = true +post.responses.default.content.application/json.example.0.id = 1 +post.responses.default.content.application/json.example.0.value = CAFE +post.responses.default.content.application/json.example.1.id = 2 +post.responses.default.content.application/json.example.1.value = COTE D IVOIRE +post.responses.default.content.application/json.schema.$ref = #/components/schemas/JSONStream +post.responses.default.description = Les termes sont mis en majuscule non accentué sans caractères spéciaux +post.summary = Normalisation des termes d'un texte +post.tags.0: terms-extraction +post.parameters.0.description = Indenter le JSON résultant +post.parameters.0.in = query +post.parameters.0.name = indent +post.parameters.0.schema.type = boolean + +[use] +plugin = @ezs/basics + +[JSONParse] +separator = * + +[assign] +path = value +value = get('value').deburr().replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/\s]+/g, ' ').trim().upperCase() + +[dump] +indent = env('indent', false)