API access of main functions
interface:
http/https
url:
passare.ru/direct_query.php?q=
character encoding:
UTF8
How to access
- connect to the server;
- send a query string ending with the zero byte;
- receive the response string ending with the zero byte;
- close the connection.
List of API accessible functions
- Verbs (ru_verb) with the arguments: verb (use indefinite form); person; number; gender; tense
- Nouns (ru_noun) with the arguments: noun (use singular nominative form); number; case
- Adjectives (ru_adjective) with the arguments: adjective (use masculine singular nominative form); number; gender; case; animacy
- Adverbs (ru_adverb) with the arguments: adverb; comparative/superlative form
- Numerals (ru_numeral):
- Cardinals with the arguments: number; card;
- Ordinals with the arguments: number; ordi;
- Fractions with the arguments: number (e.g. 1/2); frac;
- Cardinal + noun matching (ru_nounnumber) with the arguments: number; noun; case
- Weather forecast (ru_synthesis_weather) with the arguments: city
- Noun + verb matching (ru_nounverb) - with the arguments: noun; number; verb; tense
- Personal pronoun + verb matching(ru_ppronounverb):
- 1 variant - with the arguments: personal pronoun; verb; tense
- 2 variant - with the arguments: verb; number; gender; person; tense
- Lemmatization of noun, verb, or adjective(ru_lemma):
- 1 variant - with the arguments: word form.
returns: array of lemmas (up to 3 lemmas) separated by ';'
- 2 variant - with the arguments: word form; part of speech(noun | verb | adjective).
returns: lemma
- Names, surnames, patronymics (ru_name) - arguments: name, surname or patronymic (use singular nominative form); number; case
List of arguments
- Person;
- p1 - 1st person
- p2 - 2nd person
- p3 - 3rd person
- Number:
- n1 - Singular
- nx - Indefinite plural
- n2 - Plural for numerals like 2, 3, 4, 22, 23, 24, etc.
- n5 - Plural for numerals like 5, 6, 7, 8, etc.
- Gender:
- gm - Masculine
- gf - Feminine
- gn - Neuter
- Tense:
- tc - Present
- tp - Past
- tf - Future
- Case:
- ci - Imenitelnyj (Nominative)
- cr - Roditelnyj (Genitive)
- cd - Datelnyj (Dative)
- cv - Vinitelnyj (Accusative)
- ct - Tvoritelnyj (Instrumental)
- cp - Predlozhnyj (Prepositional)
- Animacy:
- a - Animate
- an - Inanimate
- Adverb form:
- fc - Comparative
- fs - Superlative
- Type of a numeral:
- card - Cardinal
- ordi - Ordinal
- frac - Fractional
Examples of query strings
- ru_verb;ехать;p3;n1;gm;tc
- ru_noun;арбуз;n1;cp
- ru_adjective;красный;nx;gf;ci;an
- ru_adverb;быстро;fc
- ru_numeral;30;card
- ru_numeral;67;ordi
- ru_numeral;2/5;frac
- ru_nounnumber;2048;решетка;cr
- ru_synthesis_weather;тверь
- ru_nounverb;компьютер;nx;работать;tp
- ru_ppronounverb;она;знать;tf
- ru_ppronounverb;знать;n1;gf;p3;tf
- ru_lemma;красные;adjective
- ru_name;Михаил;cd;n1
Examples of implementation
PHP
$query = 'ru_noun;машина;cr;nx';
$response = file_get_contents('http://passare.ru/direct_query.php?q='.$query);
echo $response;
//Output: машин
JavaScript
var query = 'ru_noun;машина;cr;nx';
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", 'http://passare.ru/direct_query.php?q='+query, false );
xmlHttp.send( null );
console.log(xmlHttp.responseText);
//Output: машин
Function testing