$nlp.conform
Coordinates Russian words with numerals (chooses an appropriate case).
Coordination is done using the PyMorphy library.
Syntax
- ECMAScript 5
- ECMAScript 6
nlp.conform("яблоко", 5); // => "яблок"
In the ECMAScript 6 runtime, the method is asynchronous:
await nlp.conform("яблоко", 5); // => "яблок"
How to use
- ECMAScript 5
- ECMAScript 6
script:
$session.points = $nlp.conform("правильный", $session.myPoints) + " " + $nlp.conform("ответ", $session.myPoints);
a: У тебя {{$session.myPoints}} {{$session.points}}.
scriptEs6:
$session.points = (await $nlp.conform("правильный", $session.myPoints)) + " " + (await $nlp.conform("ответ", $session.myPoints));
a: У тебя {{$session.myPoints}} {{$session.points}}.