The sembla-mots API generates words which seem occitan but which doesn't exists in occitan.
The application basic URL is http://api.locongres.org/semblamots.php. You have to add mandatory parameters and you can add facultative parameters. If you don't know how to add parameters in an URL, you can read this tutorial.
You have to add the following parameters :
For instance, if you want to generate a 5-letters pseudoword in lengadocian occitan, you have to use the URL http://api.locongres.org/semblamots.php?key=[la_vòsta_clau_API]&length=5&var=lengadoc. You get the following result :
{
"query": [
{
"entar",
}
]
}
You can specify the first character you want the pseudoword to have with the "firstchar" parameter. Its value must be an occitan letter without diacritical sign.
For instance, if you want to generate a pseudoword with 6 letters in Gascony occitan which begins with an "a", you have to use the URL http://api.locongres.org/semblamots.php?key=[la_vòsta_clau_API]&length=6&var=gascon&firstchar=a. You get the following result :
{
"query": [
{
"aconas",
}
]
}
The default output format is JSON. But you can get an XML output in adding "format=xml" to the l'URL.
For instance, if you want to generate a pseudoword with 8 letters in Gascony occitan in XML format, you can use the URL http://api.locongres.org/semblamots.php?key=[la_vòsta_clau_API]&length=8&var=gascon&format=xml. You get the following result :
<query>
<pseudoword id="1">lassasta</pseudoword>
</query>
If there are errors in the input URL or if the query returns no form, the API returns an error with a code and an error text in english. You can see below the error codes with their text :
The output you get is a pseudoword.
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"description": "The unique identifier for an error",
"type": "integer"
},
"text": {
"description": "A description of the error",
"type": "string"
}
},
"required": ["code", "text"]
},
"query": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,,
"maxItems": 1
}
}
}
<! ELEMENT query (nonmot) >
<! ELEMENT error (#PCDATA) >
<! ATTLIST error code ID #REQUIRED >
<! ELEMENT nonmot (#PCDATA) >
<! ATTLIST nonmot id ID #REQUIRED >
© Lo Congrès Permanent de la Lenga Occitana, 2017, all rights reserved - Contact Lo Congrès