API e modules

API rimas - Mòde d'emplec

L'API rimas que permet d'aver los mots en occitan qui riman dab un mot qui balhatz.

L'URL d'entrada

L'URL de basa de l'aplicacion qu'ei http://api.locongres.org/rhymes.php. Que i cau ajustar los paramètres obligatòris e que s'i pòt ajustar un paramètre facultatiu. Si ne sabetz pas ajustar paramètres a un URL, que'vs renviam a aqueth tutoriau.

Los paramètres obligatòris

Que cau obligatòriament indicar los paramètres seguents :

  • La vòsta clau API : tà utilizar las API deu Congrès, que cau indicar ua clau API personau qui'vs podem balhar sus la pagina dedicada. Que la cau marcar dab lo paramètre "key".
  • Lo mot : marcar lo mot dont voletz recercar las rimas dab lo paramètre "term".

Per exemple, tà cercar mots qui riman dab "tastar" en totas las varietats de l'occitan, que's pòt utilizar l'URL http://api.locongres.org/rhymes.php?key=[la_vòsta_clau_API]&term=tastar. Qu'avetz lo resultat seguent :

{
    "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",
        }
    ]
}

Los paramètres facultatius

La varietat

Que podetz indicar en quau varietat de l'occitan e cercatz rimas dab lo paramètre "var". Peu moment, qu'accèpta las valors "auvern" (tà l'occitan auvernhat), "gascon" (tà l'occitan gascon), "lemosin" (tà l'occitan lemosin), "lengadoc" (tà l'occitan lengadocian), "provenc" (tà l'occitan provençau) e "vivaraup" (tà l'occitan vivaroaupenc).

Per exemple, tà cercar mots qui riman dab "trobat" en occitan vivaroaupenc, que's pòt utilizar l'URL http://api.locongres.org/rhymes.php?key=[la_vòsta_clau_API]&term=trobat&var=vivaraup. Qu'avetz lo resultat seguent :

{
    "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"
        }
    ]
}

Lo tipe de rimas

Que's pòt indicar ua recèrca sonque dab rimas ricas o sonque dab rimas pauras dab lo paramètre "type" qui pren com valors "r" (rimas ricas) e "p" (rimas pauras).

Per exemple, tà cercar rimas ricas tau mot "nenet" en occitan provençau, que's pòt utilizar l'URL http://api.locongres.org/rhymes.php?key=[la_vòsta_clau_API]&term=nenet&var=provenc&type=r. Qu'avetz lo resultat seguent

{
    "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"
        }
    ]
}

Lo format de sortida

Per defaut, lo format de sortida qu'ei JSON. Mes que's pòt aver ua sortida au format XML en ajustant "format=xml" a l'URL.

Per exemple, tà afichar mots en occitan lengadocian qui riman dab "amic" au format XML, que's pòt utilizar l'URL http://api.locongres.org/rhymes.php?key=[la_vòsta_clau_API]&term=amic&var=lengadoc&format=xml. Qu'avetz lo resultat seguent

<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>

Las errors

Si i a errors dens l'URL picada o que la requèsta ne torna pas nada forma, l'API que'vs torna ua error dab un còdi e un tèxte d'error en anglés. Qu'avetz ací-devath, tà cada còdi d'error, la revirada deu son tèxte en occitan :

  • 1 : Que cau indicar ua clau API
  • 2 : Clau API invalida
  • 3 : Format incorrècte ("json" e "xml" permés)
  • 4 : Que cau marcar un mot
  • 5 : Que cau marcar ua varietat
  • 6 : Varietat incorrècta ("auvern", "gascon", "lemosin", "lengadoc", "provenc" e "vivaraup" permés)
  • 7 : Tipe incorrècte ("p" e "r" permés)
  • 8 : N'avem pas trobat nada rima dab las vòstas especificacions

Las informacions en sortida

En sortida, qu'avetz ua lista de mots dab un identificant unic. Per cadun qu'ei balhat :

  • La soa ortografia
  • La soa categoria gramaticau
  • La soa varietat : "oc-auvern" (occitan auvernhat), "oc-gascon" (occitan gascon), "oc-lemosin" (occitan lemosin), "oc-lengadoc" (occitan lengadocian), "oc-provenc" (occitan provençau), "oc-vivaraup" (occitan vivaroaupenc)

Las categorias gramaticaus que son marcadas dab la nòrma Eagles. Qu'avetz un explic de quin Lo Congrès e utiliza la nòrma Eagles au capítol 5 d'aqueth 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, tots los drets reservats - Contactar Lo Congrès