API & modules

API rimas - Notice

The rimas API allows you to get occitan words that rhymes with a word you give.

Input URL

The application basic URL is http://api.locongres.org/rhymes.php. You have to add mandatory parameters and you can add a facultative parameter. If you don't know how to add parameters in an URL, you can read this tutorial.

Mandatory parameters

You have to add the following parameters :

  • Your API key : to use Lo Congrès API, you have to specify a personal API key you can get on the dedicate page. You specify the API key with the "key" parameter.
  • Word : you have to specify the word of which you want to search rhymes with the "term" parameter.

For instance, if you want to search words that rhymes with "tastar" in every occitan variety, you have to use the URL http://api.locongres.org/rhymes.php?key=[your_APIkey]&term=tastar. You get the following result :

{
    "query":[
        {
            "orth": "abastar",
            "PoS": "V00005000000000",
            "var": "oc-lengadoc"
        },
        {
            "orth": "postar",
            "PoS": "V00005000000000",
            "var": "oc-lengadoc"
        },
        {
            "orth": "prestar",
            "PoS": "V00005000000000",
            "var": "oc-lengadoc"
        },
        {
            "orth": "pretextar",
            "PoS": "V00005000000000",
            "var": "oc-lengadoc"
        },
        {
            "orth": "protestar",
            "PoS": "V00005000000000",
            "var": "oc-lengadoc"
        },
        {
            "orth": "quistar",
            "PoS": "V00005000000000",
            "var": "oc-lengadoc"
        },
        {
            "orth": "rabastar",
            "PoS": "V00005000000000",
            "var": "oc-lengadoc"
        },
        {
            "orth": "rajustar",
            "PoS": "V00005000000000",
            "var": "oc-lengadoc"
        },
        {
            "orth": "reconquistar",
            "PoS": "V00005000000000",
            "var": "oc-lengadoc"
        },
        {
            "orth": "respostar",
            "PoS": "V00005000000000",
            "var": "oc-lengadoc"
        },
        {
            "orth": "restar",
            "PoS": "V00005000000000",
            "var": "oc-lengadoc"
        },
        {
            "orth": "questar",
            "PoS": "V00005000000000",
            "var": "oc-gascon"
        },
        {
            "orth": "quistar",
            "PoS": "V00005000000000",
            "var": "oc-gascon"
        },
        {
            "orth": "rabostar",
            "PoS": "V00005000000000",
            "var": "oc-gascon"
        },
        {
            "orth": "reajustar",
            "PoS": "V00005000000000",
            "var": "oc-gascon"
        },
        {
            "orth": "reconquistar",
            "PoS": "V00005000000000",
            "var": "oc-gascon"
        },
        {
            "orth": "resistar",
            "PoS": "V00005000000000",
            "var": "oc-gascon"
        },
        {
            "orth": "respostar",
            "PoS": "V00005000000000",
            "var": "oc-gascon"
        },
        {
            "orth": "restar",
            "PoS": "V00005000000000",
            "var": "oc-gascon"
        },
        {
            "orth": "riostar",
            "PoS": "V00005000000000",
            "var": "oc-gascon"
        },
        {
            "orth": "ripostar",
            "PoS": "V00005000000000",
            "var": "oc-gascon"
        },
        {
            "orth": "rostar",
            "PoS": "V00005000000000",
            "var": "oc-gascon"
        },
        {
            "orth": "refutar",
            "PoS": "V00005000000000",
            "var": "oc-provenc"
        },
        {
            "orth": "regentar",
            "PoS": "V00005000000000",
            "var": "oc-provenc"
        },
        {
            "orth": "regitar",
            "PoS": "V00005000000000",
            "var": "oc-provenc"
        },
        {
            "orth": "reglamentar",
            "PoS": "V00005000000000",
            "var": "oc-provenc"
        },
        {
            "orth": "regostar",
            "PoS": "N11100",
            "var": "oc-provenc"
        },
        {
            "orth": "regretar",
            "PoS": "V00005000000000",
            "var": "oc-provenc"
        },
        {
            "orth": "rementar",
            "PoS": "V00005000000000",
            "var": "oc-provenc"
        },
        {
            "orth": "remontar",
            "PoS": "V00005000000000",
            "var": "oc-provenc"
        },
        {
            "orth": "repintar",
            "PoS": "V00005000000000",
            "var": "oc-provenc"
        },
        {
            "orth": "vantar",
            "PoS": "V00005000000000",
            "var": "oc-vivaraup"
        },
        {
            "orth": "vegetar",
            "PoS": "V00005000000000",
            "var": "oc-vivaraup"
        },
        {
            "orth": "ventar",
            "PoS": "V00005000000000",
            "var": "oc-vivaraup"
        },
        {
            "orth": "vesitar",
            "PoS": "V00005000000000",
            "var": "oc-vivaraup"
        },
        {
            "orth": "violentar",
            "PoS": "V00005000000000",
            "var": "oc-vivaraup"
        },
        {
            "orth": "visitar",
            "PoS": "V00005000000000",
            "var": "oc-vivaraup"
        },
        {
            "orth": "votar",
            "PoS": "V00005000000000",
            "var": "oc-vivaraup",
        }
    ]
}

The facultative parameters

The variety

You can specify in which occitan variety you want to search rhymes with the "var" parameter. For the moment, its allows the values "auvern" (for Auvergne occitan), "gascon" (for Gascony occitan), "lemosin" (for Limousin occitan), "lengadoc" (for Languedoc occitan), "provenc" (for Provence occitan) and "vivaraup" (for vivaroalpine occitan).

For instance, if you want to search words that rhymes with "trobat" in vivaroalpine occitan, you have to use the URL http://api.locongres.org/rhymes.php?key=[your_APIkey]&term=trobat&var=vivaraup. You get the following result :

{
    "query": [
        {
            "orth": "bac",
            "PoS": "N1110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "bas",
            "PoS": "N1110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "bas",
            "PoS": "AJ0110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "abat",
            "PoS": "N1110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "bab\u00e0",
            "PoS": "N1110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "sabat",
            "PoS": "N1110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "inachabat",
            "PoS": "AJ0110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "acabat",
            "PoS": "AJ0110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "inacabat",
            "PoS": "AJ0110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "escarabat",
            "PoS": "N1110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "grabat",
            "PoS": "N1110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "tabat",
            "PoS": "N1110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "debat",
            "PoS": "N1110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "rebat",
            "PoS": "N1110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "rebat",
            "PoS": "N1210",
            "var": "oc-vivaraup"
        },
        {
            "orth": "crebat",
            "PoS": "AJ0110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "aqu\u00ed-bas",
            "PoS": "AV0000",
            "var": "oc-vivaraup"
        },
        {
            "orth": "celibat",
            "PoS": "N1110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "ribas",
            "PoS": "N1110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "destibat",
            "PoS": "AJ0110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "combat",
            "PoS": "N1110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "catacombas",
            "PoS": "N1220",
            "var": "oc-vivaraup"
        },
        {
            "orth": "tombat",
            "PoS": "N1110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "barbat",
            "PoS": "AJ0110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "corbat",
            "PoS": "AJ0110",
            "var": "oc-vivaraup"
        },
        {
            "orth": "ubac",
            "PoS": "N1110"
        }
    ]
}

Rhymes type

You can specify if you wanto only rich rhymes or only poor rhymes with the "type" parameter which allows the values "r" (rich rhymes) e "p" (poor rhymes).

For instance, if you want to search rich rhymes for the word "nenet" en Provence occitan, you can use the URL http://api.locongres.org/rhymes.php?key=[your_APIkey]&term=nenet&var=provenc&type=r. You get the following result :

{
    "query": [
        {
            "orth": "net",
            "PoS": "AJ0110",
            "var": "oc-provenc"
        },
        {
            "orth": "anet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "nanet",
            "PoS": "AJ0110",
            "var": "oc-provenc"
        },
        {
            "orth": "nanet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "senec",
            "PoS": "AJ0110",
            "var": "oc-provenc"
        },
        {
            "orth": "omenet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "momenet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "penet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "gabinet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "robinet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "minet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "caminet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "ninet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "bonet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "guionet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "lionet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "molonet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "monet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "quasernet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "cornet",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "torneg",
            "PoS": "N1110",
            "var": "oc-provenc"
        },
        {
            "orth": "maunet",
            "PoS": "AJ0110"
        }
    ]
}

Output format

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 display Languedoc occitan words that rhymes with "amic" in XML format, you can use the URL http://api.locongres.org/rhymes.php?key=[your_APIkey]&term=amic&var=lengadoc&format=xml. Vous obtenez le résultat suivant

<query>
    <form id="1">
        <orth>balsamic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="2">
        <orth>adamic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="3">
        <orth>criptogamic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="4">
        <orth>islamic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="5">
        <orth>dinamic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="6">
        <orth>aerodinamic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="7">
        <orth>idrodinamic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="8">
        <orth>electrodinamic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="9">
        <orth>ceramic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="10">
        <orth>panoramic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="11">
        <orth>protoplasmic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="12">
        <orth>sismic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="13">
        <orth>osmic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="14">
        <orth>cosmic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="15">
        <orth>racemic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="16">
        <orth>septicemic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="17">
        <orth>academic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="18">
        <orth>epidemic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="19">
        <orth>endemic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="20">
        <orth>eufemic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="21">
        <orth>polemic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="22">
        <orth>anemic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="23">
        <orth>enemic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="24">
        <orth>enemic</orth>
        <PoS>N1110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="25">
        <orth>totemic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="26">
        <orth>quimic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="27">
        <orth>bioquimic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="28">
        <orth>cacoquimic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="29">
        <orth>fisico-quimic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="30">
        <orth>electroquimic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="31">
        <orth>fotoquimic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="32">
        <orth>mimic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="33">
        <orth>sinonimic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="34">
        <orth>toponimic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="35">
        <orth>paronimic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="36">
        <orth>metonimic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="37">
        <orth>timic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="38">
        <orth>oftalmic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="39">
        <orth>ritmic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="40">
        <orth>aritmic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="41">
        <orth>logaritmic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="42">
        <orth>vomic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="43">
        <orth>somic</orth>
        <PoS>N1110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="44">
        <orth>comic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="45">
        <orth>comic</orth>
        <PoS>N1110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="46">
        <orth>tragi-comic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="47">
        <orth>taxonomic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="48">
        <orth>fisionomic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="49">
        <orth>economic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="50">
        <orth>astronomic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="51">
        <orth>gastronomic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="52">
        <orth>gnomic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="53">
        <orth>cromic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="54">
        <orth>atomic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="55">
        <orth>monoatomic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="56">
        <orth>diatomic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="57">
        <orth>anatomic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="58">
        <orth>tricotomic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="59">
        <orth>dermic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="60">
        <orth>epidermic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="61">
        <orth>ipodermic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="62">
        <orth>termic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="63">
        <orth>atermic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="64">
        <orth>antitermic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="65">
        <orth>exotermic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="66">
        <orth>endotermic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="67">
        <orth>isotermic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
    <form id="68">
        <orth>formic</orth>
        <PoS>AJ0110</PoS>
        <var>oc-lengadoc</var>
    </form>
</query>

Errors

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 :

  • 1 : An API key is required
  • 2 : Invalid API key
  • 3 : Incorrect format ('json' and 'xml' allowed)
  • 4 : A term is required
  • 5 : A variety is required
  • 6 : Incorrect variety ("auvern", "gascon", "lemosin", "lengadoc", "provenc" and "vivaraup" allowed)
  • 7 : Incorrect type ('r' and 'p' allowed)
  • 8 : No rhyme found with your conditions

Output informations

The output you get is a list of words with an unique ID. For each one, you get :

  • Its spelling
  • Its grammatical category
  • Its occitan variety : "oc-auvern" (Auvergne occitan), "oc-gascon" (Gascony occitan), "oc-lemosin" (Limousin occitan), "oc-lengadoc" (Languedoc occitan), "oc-provenc" (Provence occitan) and "oc-vivaraup" (vivaroalpine occitan)

Grammatical categories are given with Eagles norm. You will find an explanation about the way Lo Congrès use Eagles norm in the fifth chapter of this document.

JSON schema

{
    "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": "object",
                "properties": {
                    "orth": {
                        "type": "string"
                    },
                    "PoS": {
                        "type": "string"
                    },
                    "var": {
                        "type": "string"
                    },
                },
                "required": ["orth", "PoS", "var"]
            },
            "minItems": 1
        }
    }
}

DTD XML

<! ELEMENT query (form) >

<! ELEMENT error (#PCDATA) >
<! ATTLIST error code ID #REQUIRED >

<! ELEMENT form (orth, PoS, var) >
<! ATTLIST form id ID #REQUIRED >

<! ELEMENT orth (#PCDATA) >

<! ELEMENT PoS (#PCDATA) >

<! ELEMENT var (#PCDATA) >

© Lo Congrès Permanent de la Lenga Occitana, 2017, all rights reserved - Contact Lo Congrès