blob: 8929289dec9ee592b8ef9f21251a624d9e47a654 [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# IDL functions documentation.
#
fn-ent:
- name: ent_type
sig: |
<b>ent_type</b>(t: Entity<em><sub>opt</sub></em>) ⇒ String, # ⇒ String
synopsis: Returns <a href="/apis/latest/org/apache/nlpcraft/NCEntity.html#getType-0">entity type</a>
desc: |
Returns <a href="/apis/latest/org/apache/nlpcraft/NCEntity.html#getType-0">entity type</a>
for the current entity (default) or the provided one by the optional parameter <code><b>t</b></code>. Note that this
functions has a special shorthand <code><b>#</b></code>.
usage: |
// Result: 'true' if the current entity type is equal to 'my_type'.
ent_type == 'my_type'
# == 'my_type'
ent_type(ent_this) == 'my_type'
#(ent_this) == 'my_type'
- name: ent_groups
sig: |
<b>ent_groups</b>(t: Entity<em><sub>opt</sub></em>) ⇒ List[String]
synopsis: Gets the list of <a class="not-code" href="/apis/latest/org/apache/nlpcraft/NCEntity.html#getGroups-0">groups</a> this entity belongs to
desc: |
Gets the list of <a class="not-code" href="/apis/latest/org/apache/nlpcraft/NCEntity.html#getGroups-0">groups</a>
the current entity (default) or the provided one by the optional parameter <code><b>t</b></code> belongs to. Note that,
by default, if not specified explicitly, entity always belongs to one group with type equal to entity type.
May return an empty list but never a <code>null</code>.
usage: |
// Result: list of groups this entity belongs to.
ent_groups
ent_groups(ent_this)
- name: ent_this
sig: |
<b>ent_this</b> ⇒ Entity
synopsis: Returns current entity
desc: |
Returns current entity.
usage: |
// Result: current entity.
ent_this
- name: ent_text
sig: |
<b>ent_text</b>(t: Entity<em><sub>opt</sub></em>) ⇒ String
synopsis: Returns entity's original text
desc: |
Returns <a class="not-code" href="/apis/latest/org/apache/nlpcraft/NCEntity.html#mkText-0">entity's original text</a>.
If <code>t</code> is not provided the current entity is assumed.
usage: |
// Result: entity original input text.
ent_text
- name: ent_index
sig: |
<b>ent_index</b>(t: Entity<em><sub>opt</sub></em>) ⇒ Long
synopsis: Returns entity's index in the original input
desc: |
Returns entity's index in the original input. Note that this is an index of the entity and not of the character.
If <code>t</code> is not provided the current entity is assumed.
usage: |
// Result: 'true' if index of this entity in the original input is equal to 1.
ent_index == 1
ent_index(ent_this) == 1
- name: ent_is_first
sig: |
<b>ent_is_first</b>(t: Entity<em><sub>opt</sub></em>) ⇒ Boolean
synopsis: Returns <code>true</code> if this entity is the first in the original input
desc: |
Returns <code>true</code> if this entity is the first in the original input. Note that this checks index of the entity and not of the character.
If <code>t</code> is not provided the current entity is assumed.
usage: |
// Result: 'true' if this entity is the first entity in the original input.
ent_is_first
ent_is_first(ent_this)
- name: ent_is_last
sig: |
<b>ent_is_last</b>(t: Entity<em><sub>opt</sub></em>) ⇒ Boolean
synopsis: Returns <code>true</code> if this entity is the last in the original input
desc: |
Returns <code>true</code> if this entity is the last in the original input. Note that this checks index of the entity and not of the character.
If <code>t</code> is not provided the current entity is assumed
usage: |
// Result: 'true' if this entity is the last entity in the original input.
ent_is_last
ent_is_last(ent_this)
- name: ent_is_before_type
sig: |
<b>ent_is_before_type</b>(type: String) ⇒ Boolean
synopsis: Returns <code>true</code> if there is a entity with type <code>type</code> after this entity
desc: |
Returns <code>true</code> if there is a entity with type <code>type</code> after this entity.
usage: |
// Result: 'true' if there is a entity with type 'a' after this entity.
ent_is_before_type('a')
- name: ent_is_after_type
sig: |
<b>ent_is_after_type</b>(type: String) ⇒ Boolean
synopsis: Returns <code>true</code> if there is a entity with type <code>type</code> before this entity
desc: |
Returns <code>true</code> if there is a entity with type <code>type</code> before this entity.
usage: |
// Result: 'true' if there is a entity with type 'a' before this entity.
ent_is_after_type('a')
- name: ent_is_between_types
sig: |
<b>ent_is_between_types</b>(type1: String, type2: String) ⇒ Boolean
synopsis: Returns <code>true</code> if this entity is located between entities with types <code>type1</code> and <code>type2</code>
desc: |
Returns <code>true</code> if this entity is located between entities with types <code>type1</code> and <code>type2</code>.
usage: |
// Result: 'true' if this entity is located after entity with type 'before' and before the entity with type 'after'.
ent_is_between_types('before', 'after')
- name: ent_is_between_groups
sig: |
<b>ent_is_between_groups</b>(grp1: String, grp2: String) ⇒ Boolean
synopsis: Returns <code>true</code> if this entity is located between entities with group IDs <code>grp1</code> and <code>grp2</code>
desc: |
Returns <code>true</code> if this entity is located between entities with group IDs <code>grp1</code> and <code>grp2</code>.
usage: |
// Result: 'true' if this entity is located after entity belonging to the group 'before' and before the entity belonging to the group 'after'.
ent_is_between_groups('before', 'after')
- name: ent_is_before_group
sig: |
<b>ent_is_before_group</b>(grp: String) ⇒ Boolean
synopsis: |
Returns <code>true</code> if there is a entity that belongs to the
<a class="not-code" href="/apis/latest/org/apache/nlpcraft/NCEntity.html#getGroups-0">group</a>
<code>grp</code> after this entity
desc: |
Returns <code>true</code> if there is a entity that belongs to the
<a class="not-code" href="/apis/latest/org/apache/nlpcraft/NCEntity.html#getGroups-0">group</a>
<code>grp</code> after this entity.
usage: |
// Result: 'true' if there is a entity that belongs to the group 'grp' after this entity.
ent_is_before_group('grp')
- name: ent_is_after_group
sig: |
<b>ent_is_after_group</b>(grp: String) ⇒ Boolean
synopsis: |
Returns <code>true</code> if there is a entity that belongs to the
<a class="not-code" href="/apis/latest/org/apache/nlpcraft/NCEntity.html#getGroups-0">group</a>
<code>grp</code> before this entity
desc: |
Returns <code>true</code> if there is a entity that belongs to the
<a class="not-code" href="/apis/latest/org/apache/nlpcraft/NCEntity.html#getGroups-0">group</a>
<code>grp</code> before this entity.
usage: |
// Result: 'true' if there is a entity that belongs to the group 'grp' before this entity.
ent_is_after_group('grp')
- name: ent_all
sig: |
<b>ent_all</b> ⇒ List[Entity]
synopsis: |
Returns all entities from the original input
desc: |
Returns all entities from the original input.
usage: |
// Result: list of all entities for the original input.
ent_all
- name: ent_count
sig: |
<b>ent_count</b> ⇒ Long
synopsis: |
Returns number of entities from the original input
desc: |
Returns number of entities from the original input.
It is equivalent to <code>size(ent_all)</code>
usage: |
// Result: number of all entities for the original input.
ent_count
- name: ent_all_for_type
sig: |
<b>ent_all_for_type</b>(type: String) ⇒ List[Entity]
synopsis: |
Returns list of entities from the original input with type <code>type</code>
desc: |
Returns list of entities from the original input with type <code>type</code>.
usage: |
// Result: list of entities for the original input that have type 'type'.
ent_all_for_type('type')
- name: ent_all_for_group
sig: |
<b>ent_all_for_group</b>(grp: String) ⇒ List[Entity]
synopsis: |
Returns list of entities from the original input that belong to the group <code>grp</code>
desc: |
Returns list of entities from the original input that belong to the group <code>grp</code>.
usage: |
// Result: list of entities for the original input that belong to th group 'grp'.
ent_all_for_group('grp')
fn-datetime:
- name: year
sig: |
<b>year</b> ⇒ Long
synopsis: Returns current year
desc: |
Returns current year.
usage: |
// Result: 2021
year
- name: month
sig: |
<b>month</b> ⇒ Long
synopsis: |
Returns current month: 1 ... 12
desc: |
Returns current month: 1 ... 12.
usage: |
// Result: 5
month
- name: day_of_month
sig: |
<b>day_of_month</b> ⇒ Long
synopsis: |
Returns current day of the month: 1 ... 31
desc: |
Returns current day of the month: 1 ... 31.
usage: |
// Result: 5
day_of_month
- name: day_of_week
sig: |
<b>day_of_week</b> ⇒ Long
synopsis: |
Returns current day of the week: 1 ... 7
desc: |
Returns current day of the week: 1 ... 7.
usage: |
// Result: 5
day_of_week
- name: day_of_year
sig: |
<b>day_of_year</b> ⇒ Long
synopsis: |
Returns current day of the year: 1 ... 365
desc: |
Returns current day of the year: 1 ... 365.
usage: |
// Result: 51
day_of_year
- name: hour
sig: |
<b>hour</b> ⇒ Long
synopsis: |
Returns current hour: 0 ... 23
desc: |
Returns current hour: 0 ... 23.
usage: |
// Result: 11
hour
- name: minute
sig: |
<b>minute</b> ⇒ Long
synopsis: |
Returns current minute: 0 ... 59
desc: |
Returns current minute: 0 ... 59.
usage: |
// Result: 11
minute
- name: second
sig: |
<b>second</b> ⇒ Long
synopsis: |
Returns current second: 0 ... 59
desc: |
Returns current second: 0 ... 59.
usage: |
// Result: 11
second
- name: week_of_month
sig: |
<b>week_of_month</b> ⇒ Long
synopsis: |
Returns current week of the month: 1 ... 4
desc: |
Returns current week of the month: 1 ... 4.
usage: |
// Result: 2
week_of_month
- name: week_of_year
sig: |
<b>week_of_year</b> ⇒ Long
synopsis: |
Returns current week of the year: 1 ... 56
desc: |
Returns current week of the year: 1 ... 56.
usage: |
// Result: 21
week_of_year
- name: quarter
sig: |
<b>quarter</b> ⇒ Long
synopsis: |
Returns current quarter: 1 ...4
desc: |
Returns current quarter: 1 ... 4.
usage: |
// Result: 2
quarter
- name: now
sig: |
<b>now</b> ⇒ Long
synopsis: |
Returns current time in milliseconds
desc: |
Returns current time in milliseconds.
usage: |
// Result: 122312341212
now
fn-req:
- name: req_id
sig: |
<b>req_id</b> ⇒ String
synopsis: Returns <a class="not-code" href="/apis/latest/org/apache/nlpcraft/NCRequest.html#getRequestId-0">request ID</a>
desc: |
Returns <a class="not-code" href="/apis/latest/org/apache/nlpcraft/NCRequest.html#getRequestId-0">request ID</a>.
usage: |
// Result: request ID.
req_id
- name: req_text
sig: |
<b>req_text</b> ⇒ String
synopsis: Returns request <a class="not-code" target="javadoc" href="/apis/latest/org/apache/nlpcraft/NCRequest.html#getText-0">text</a>
desc: |
Returns request <a class="not-code" target="javadoc" href="/apis/latest/org/apache/nlpcraft/NCRequest.html#getText-0">text</a>.
usage: |
// Result: request text.
req_text
- name: req_tstamp
sig: |
<b>req_tstamp</b> ⇒ Long
synopsis: Gets UTC/GMT receive <a class="not-code" target="javadoc" href="/apis/latest/org/apache/nlpcraft/NCRequest.html#getReceiveTimestamp-0">timestamp</a>
desc: |
Gets UTC/GMT <a class="not-code" target="javadoc" href="/apis/latest/org/apache/nlpcraft/NCRequest.html#getReceiveTimestamp-0">timestamp</a>
in ms when user input was received.
usage: |
// Result: input receive timsstamp in ms.
req_tstamp
- name: user_id
sig: |
<b>user_id</b> ⇒ String
synopsis: Returns <code>user ID</code>
desc: |
Returns <code>user ID</code>
usage: |
// Result: user ID.
user_id
fn-math:
- name: abs
sig: |
<b>abs</b>(x: {Long|Double}) ⇒ {Long|Double}
synopsis: Returns absolute value for parameter <code><b>x</b></code>
desc: |
Returns absolute value for parameter <code><b>x</b></code>.
usage: |
// Result: 1
abs(-1)
// Result: 1.5
abs(-1.5)
- name: ceil
sig: |
<b>ceil</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#ceil(double)"><code>Math.ceil(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#ceil(double)"><code>Math.ceil(<b>d</b>)</code></a>.
usage: |
// Result: 2.0
ceil(1.5)
- name: floor
sig: |
<b>floor</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#floor(double)"><code>Math.floor(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#floor(double)"><code>Math.floor(<b>d</b>)</code></a>.
usage: |
// Result: 1.0
floor(1.5)
- name: rint
sig: |
<b>rint</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#rint(double)"><code>Math.rint(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#rint(double)"><code>Math.rint(<b>d</b>)</code></a>.
usage: |
// Result: 1.0
rint(1.2)
- name: round
sig: |
<b>round</b>(d: Double) ⇒ Long
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#round(double)"><code>Math.round(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#round(double)"><code>Math.round(<b>d</b>)</code></a>.
usage: |
// Result: 1
round(1.2)
- name: signum
sig: |
<b>signum</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#signum(double)"><code>Math.signum(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#signum(double)"><code>Math.signum(<b>d</b>)</code></a>.
usage: |
// Result: 1.0
signum(1.2)
- name: sqrt
sig: |
<b>sqrt</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#sqrt(double)"><code>Math.sqrt(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#sqrt(double)"><code>Math.sqrt(<b>d</b>)</code></a>.
usage: |
// Result: 4.0
sqrt(2.0)
- name: cbrt
sig: |
<b>cbrt</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#cbrt(double)"><code>Math.cbrt(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#cbrt(double)"><code>Math.cbrt(<b>d</b>)</code></a>.
usage: |
// Result: -3.0
cbrt(-27.0)
- name: acos
sig: |
<b>acos</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#acos(double)"><code>Math.acos(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#acos(double)"><code>Math.acos(<b>d</b>)</code></a>.
usage: |
acos(1.0)
- name: asin
sig: |
<b>asin</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#asin(double)"><code>Math.asin(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#asin(double)"><code>Math.asin(<b>d</b>)</code></a>.
usage: |
asin(1.0)
- name: atan
sig: |
<b>atan</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#atan(double)"><code>Math.atan(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#atan(double)"><code>Math.atan(<b>d</b>)</code></a>.
usage: |
atan(1.0)
- name: tan
sig: |
<b>tan</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#tan(double)"><code>Math.tan(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#tan(double)"><code>Math.tan(<b>d</b>)</code></a>.
usage: |
tan(1.0)
- name: sin
sig: |
<b>sin</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#sin(double)"><code>Math.sin(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#sin(double)"><code>Math.sin(<b>d</b>)</code></a>.
usage: |
sin(1.0)
- name: cos
sig: |
<b>cos</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#cos(double)"><code>Math.cos(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#cos(double)"><code>Math.cos(<b>d</b>)</code></a>.
usage: |
cos(1.0)
- name: tanh
sig: |
<b>tanh</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#tanh(double)"><code>Math.tanh(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#tanh(double)"><code>Math.tanh(<b>d</b>)</code></a>.
usage: |
tanh(1.0)
- name: sinh
sig: |
<b>sinh</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#sinh(double)"><code>Math.sinh(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#sinh(double)"><code>Math.sinh(<b>d</b>)</code></a>.
usage: |
sinh(1.0)
- name: cosh
sig: |
<b>cosh</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#cosh(double)"><code>Math.cosh(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#cosh(double)"><code>Math.cosh(<b>d</b>)</code></a>.
usage: |
cosh(1.0)
- name: atan2
sig: |
<b>atan2</b>(d1: Double, d2: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#atan2(double, double)"><code>Math.atan2(<b>d2</b>, <b>d2</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#atan2(double, double)"><code>Math.atan2(<b>d1</b>, <b>d2</b>)</code></a>.
usage: |
atan2(1.0, 1.0)
- name: degrees
sig: |
<b>degrees</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#toDegrees(double)"><code>Math.toDegrees(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#toDegrees(double)"><code>Math.toDegrees(<b>d</b>)</code></a>.
usage: |
degrees(1.0)
- name: radians
sig: |
<b>radians</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#toRadians(double)"><code>Math.toRadians(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#toRadians(double)"><code>Math.toRadians(<b>d</b>)</code></a>.
usage: |
radians(1.0)
- name: exp
sig: |
<b>exp</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#exp(double)"><code>Math.exp(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#exp(double)"><code>Math.exp(<b>d</b>)</code></a>.
usage: |
exp(1.0)
- name: expm1
sig: |
<b>expm1</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#expm1(double)"><code>Math.expm1(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#expm1(double)"><code>Math.expm1(<b>d</b>)</code></a>.
usage: |
expm1(1.0)
- name: log
sig: |
<b>log</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#log(double)"><code>Math.log(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#log(double)"><code>Math.log(<b>d</b>)</code></a>.
usage: |
log(1.0)
- name: log10
sig: |
<b>log10</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#log10(double)"><code>Math.log10(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#log10(double)"><code>Math.log10(<b>d</b>)</code></a>.
usage: |
log10(1.0)
- name: square
sig: |
<b>square</b>(x: {Long|Double}) ⇒ {Long|Double}
synopsis: Returns square of <code>><b>x</b></code>
desc: |
Returns square of <code>><b>x</b></code>
usage: |
// Result: 4
square(2)
- name: log1p
sig: |
<b>log1p</b>(d: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#log1p(double)"><code>Math.log1p(<b>d</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#log1p(double)"><code>Math.log1p(<b>d</b>)</code></a>.
usage: |
log1p(1.0)
- name: pi
sig: |
<b>pi</b> ⇒ Double
synopsis: Returns PI constant
desc: |
Returns PI constant.
usage: |
// Result: 3.14159265359
pi
- name: euler
sig: |
<b>pi</b> ⇒ Double
synopsis: Returns Euler constant
desc: |
Returns Euler constant.
usage: |
// Result: 0.5772156649
euler
- name: max
sig: |
<b>max</b>(c: List) ⇒ Any
synopsis: Returns maximum value for given list
desc: |
Returns maximum value for given list. Throws runtime exception if the list is empty.
This function uses a natural ordering.
usage: |
// Result: 3
max(list(1, 2, 3))
- name: min
sig: |
<b>min</b>(c: List) ⇒ Any
synopsis: Returns minimum value for given list
desc: |
Returns minimum value for given list. Throws runtime exception if the list is empty.
This function uses a natural ordering.
usage: |
// Result: 1
min(list(1, 2, 3))
- name: avg
sig: |
<b>avg</b>(c: List[{Long|Double|String}]) ⇒ Double
synopsis: Returns average (mean) value for given list
desc: |
Returns average (mean) value for given list of ints, doubles or strings.
Throws runtime exception if the list is empty.
If list list contains strings, they have to be convertable to int or double.
usage: |
// Result: 2.0
avg(list(1, 2, 3))
avg(list("1.0", 2, "3"))
- name: stdev
sig: |
<b>stdev</b>(c: List[{Long|Double|String}]) ⇒ Double
synopsis: Returns standard deviation value for given list
desc: |
Returns standard deviation value for given list of ints, doubles or strings.
Throws runtime exception if the list is empty.
If list list contains strings, they have to be convertable to int or double.
usage: |
stdev(list(1, 2, 3))
stdev(list("1.0", 2, "3"))
- name: pow
sig: |
<b>pow</b>(d1: Double, d2: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#pow(double, double)"><code>Math.pow(<b>d2</b>, <b>d2</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#pow(double, double)"><code>Math.pow(<b>d1</b>, <b>d2</b>)</code></a>.
usage: |
// Result: 4.0
pow(2.0, 2.0)
- name: hypot
sig: |
<b>hypot</b>(d1: Double, d2: Double) ⇒ Double
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#hypot(double, double)"><code>Math.hypot(<b>d2</b>, <b>d2</b>)</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html#hypot(double, double)"><code>Math.hypot(<b>d1</b>, <b>d2</b>)</code></a>.
usage: |
hypot(2.0, 2.0)
fn-collections:
- name: list
sig: |
<b>list</b>(t: Any...<em><sub>opt</sub></em>) ⇒ List[Any]
synopsis: Returns new list with given parameters
desc: |
Returns new list with given parameters.
usage: |
// Result: []
list
// Result: [1, 2, 3]
list(1, 2, 3)
// Result: ["1", true, 1.25]
list("1", 2 == 2, to_double('1.25'))
- name: get
sig: |
<b>get</b>(c: {List|Map}, k: {Long|Any}) ⇒ Any
synopsis: Gets element <code><b>k</b></code> from either list or map <code><b>c</b></code>
desc: |
Gets element from either list or map <code><b>c</b></code>. For list the
<code><b>k</b></code> must be 0-based integer index in the list.
usage: |
// Result: 1
get(list(1, 2, 3), 0)
// Result: true
get(json('{"a": true}'), "a")
- name: has
sig: |
<b>has</b>(c: List, x: Any) ⇒ Boolean
synopsis: Calls <code><b>c</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/util/List.html#contains(java.lang.Object)"><code>contains(<b>x</b></code>)</a>
desc: |
Calls <code><b>c</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/util/List.html#contains(java.lang.Object)"><code>contains(<b>x</b></code>)</a>
and returns its result.
usage: |
// Result: true
has(list("a", "b"), "a")
- name: has_all
sig: |
<b>has_all</b>(c: List, x: Any) ⇒ Boolean
synopsis: Calls <code><b>c</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/util/List.html#containsAll(java.util.Collection)"><code>containsAll(<b>x</b></code>)</a>
desc: |
Calls <code><b>c</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/util/List.html#containsAll(java.util.Collection)"><code>containsAll(<b>x</b></code>)</a>
and returns its result.
usage: |
// Result: false
has_all(list("a", "b"), "a")
- name: has_any
sig: |
<b>has_any</b>(c: List, x: List) ⇒ Boolean
synopsis: Checks if list <code><b>c</b></code> contains any of the elements from the list <code><b>x</b></code>
desc: |
Checks if list <code><b>c</b></code> contains any of the elements from the list <code><b>x</b></code>.
usage: |
// Result: true
has_any(list("a", "b"), list("a"))
- name: first
sig: |
<b>first</b>(c: List) ⇒ Any
synopsis: Returns first element from the list <code><b>c</b></code> or <code>null</code>
desc: |
Returns first element from the list <code><b>c</b></code> or <code>null</code> if the list is empty.
usage: |
// Result: "a"
first(list("a", "b"))
- name: last
sig: |
<b>last</b>(c: List) ⇒ Any
synopsis: Returns last element from the list <code><b>c</b></code> or <code>null</code>
desc: |
Returns last element from the list <code><b>c</b></code> or <code>null</code> if the list is empty.
usage: |
// Result: "b"
last(list("a", "b"))
- name: keys
sig: |
<b>keys</b>(m: Map) ⇒ Any
synopsis: Returns list of keys for map <code><b>m</b></code>
desc: |
Returns list of keys for map <code><b>m</b></code>.
usage: |
// Result: ["a", "b"]
keys(json('{"a": true, "b": 1}'))
- name: values
sig: |
<b>values</b>(m: Map) ⇒ Any
synopsis: Returns list of values for map <code><b>m</b></code>
desc: |
Returns list of values for map <code><b>m</b></code>.
usage: |
// Result: [true, 1]
values(json('{"a": true, "b": 1}'))
- name: reverse
sig: |
<b>reverse</b>(x: List) ⇒ List
synopsis: Reverses the list <code><b>x</b></code>
desc: |
Returns reversed list <code><b>x</b></code>. This function uses the natural sorting order.
usage: |
// Result: [3, 2, 1]
reverse(list(1, 2, 3))
- name: sort
sig: |
<b>sort</b>(x: List) ⇒ List
synopsis: Sorts the list <code><b>x</b></code>
desc: |
Returns sorted list <code><b>x</b></code>. This function uses the natural sorting order.
usage: |
// Result: [1, 2, 3]
sort(list(2, 1, 3))
- name: is_empty
sig: |
<b>is_empty</b>(x: {String|List|Map}) ⇒ Boolean
synopsis: Checks if given string, list or map is <code><b>x</b></code> empty
desc: |
Checks if given string, list or map <code><b>x</b></code> is empty.
usage: |
// Result: false
is_empty("text")
is_empty(list(1))
is_empty(json('{"a": 1}'))
- name: non_empty
sig: |
<b>non_empty</b>(x: {String|List|Map}) ⇒ Boolean
synopsis: Checks if given string, list or map is <code><b>x</b></code> non empty
desc: |
Checks if given string, list or map <code><b>x</b></code> is non empty.
usage: |
// Result: true
non_empty("text")
non_empty(list(1))
non_empty(json('{"a": 1}'))
- name: distinct
sig: |
<b>distinct</b>(x: List) ⇒ List
synopsis: Makes list <code><b>x</b></code> distinct
desc: |
Makes list <code><b>x</b></code> distinct.
usage: |
// Result: [1, 2, 3]
distinct(list(1, 2, 2, 3, 1))
- name: concact
sig: |
<b>concat</b>(x1: List, x1: List) ⇒ List
synopsis: Concatenates lists <code><b>x1</b></code> and <code><b>x2</b></code>
desc: |
Concatenates lists <code><b>x1</b></code> and <code><b>x2</b></code>.
usage: |
// Result: [1, 2, 3, 4]
concat(list(1, 2), list(3, 4))
fn-metadata:
- name: meta_ent
sig: |
<b>meta_ent</b>(p: String) ⇒ Any
synopsis: Gets entity metadata property <code><b>p</b></code>
desc: |
Gets entity metadata property <code><b>p</b></code>.
usage: |
// Result: 'nlp:token:text' entity metadata property.
meta_ent('nlp:token:text')
- name: meta_req
sig: |
<b>meta_req</b>(p: String) ⇒ Any
synopsis: Gets request metadata property <code><b>p</b></code>
desc: |
Gets request metadata property <code><b>p</b></code>.
usage: |
// Result: 'my:prop' user request data property.
meta_req('my:prop')
- name: meta_intent
sig: |
<b>meta_intent</b>(p: String) ⇒ Any
synopsis: Gets intent metadata property <code><b>p</b></code>
desc: |
Gets intent metadata property <code><b>p</b></code>.
usage: |
// Result: 'my:prop' intent metadata property.
meta_intent('my:prop')
- name: meta_conv
sig: |
<b>meta_conv</b>(p: String) ⇒ Any
synopsis: Gets conversation metadata property <code><b>p</b></code>
desc: |
Gets conversation metadata property <code><b>p</b></code>.
usage: |
// Result: 'my:prop' conversation metadata property.
meta_conv('my:prop')
- name: meta_frag
sig: |
<b>meta_frag</b>(p: String) ⇒ Any
synopsis: Gets fragment metadata property <code><b>p</b></code>
desc: |
Gets fragment metadata property <code><b>p</b></code>. Fragment metadata can be optionally passed in
when referencing the fragment to parameterize it.
usage: |
// Result: 'my:prop' fragment metadata property.
meta_frag('my:prop')
- name: meta_sys
sig: |
<b>meta_sys</b>(p: String) ⇒ Any
synopsis: Gets system property or environment variable <code><b>p</b></code>
desc: |
Gets system property or environment variable <code><b>p</b></code>.
usage: |
// Result: 'java.home' system property.
meta_sys('java.home')
// Result: 'HOME' environment variable.
meta_sys('HOME')
- name: meta_cfg
sig: |
<b>meta_cfg</b>(p: String) ⇒ Any
synopsis: Gets configuration property <code><b>p</b></code>
desc: |
Gets configuration property <code><b>p</b></code>.
usage: |
// Result: 'my:prop' configuration property.
meta_cfg('my:prop')
fn-other:
- name: if
sig: |
<b>if</b>(c: Boolean, then: Any: else: Any) ⇒ Any
synopsis: This function provides 'if-then-else' equivalent
desc: |
This function provides 'if-then-else' equivalent as IDL does not provide branching
on the language level. This function will evaluate <code><b>c</b></code> parameter and either
return <code><b>then</b></code> value if it evaluates to <code>true</code> or <code><b>else</b></code>
value in case if it evaluates to <code>false</code>. Note that evaluation will be
short-circuit, i.e. either <code><b>then</b></code> or <code><b>else</b></code> will actually be
computed but not both.
usage: |
// Result:
// - 'list(1, 2, 3)' if 1st parameter is 'true'.
// - 'null' if 1st parameter is 'false'.
if(meta_model('my_prop') == true, list(1, 2, 3), null)
- name: json
sig: |
<b>json</b>(p: String) ⇒ Map[String, Any]
synopsis: Converts JSON in <code><b>p</b></code> parameter to a map
desc: |
Converts JSON in <code><b>p</b></code> parameter to a map. Use single quoted
string to avoid escaping double quotes in JSON.
usage: |
// Result: Map.
json('{"a": 2, "b": [1, 2, 3]}')
- name: to_string
sig: |
<b>to_string</b>(p: Any) ⇒ {String|List[String]}
synopsis: Converts <code><b>p</b></code> parameter to a string
desc: |
Converts <code><b>p</b></code> parameter to a string. In case of a list
this function will convert individual list elements to string and return the
list of strings.
usage: |
// Result: "1.25"
to_string(1.25)
// Result: list("1", "2", "3")
to_string(list(1, 2, 3))
- name: or_else
sig: |
<b>or_else</b>(p: Any, a: Any) ⇒ Any
synopsis: Returns <code><b>p</b></code> if it is not <code>null</code>, <code><b>a</b></code> otherwise
desc: |
Returns <code><b>p</b></code> if it is not <code>null</code>, <code><b>a</b></code> otherwise.
Note that evaluation will be short-circuit, i.e. <code><b>a</b></code> will be evaluated only
if <code><b>p</b></code> is <code>null</code>.
usage: |
// Result: 'some_prop' model metadata or 'text' if one is 'null'.
@dflt = 'text'
or_else(meta_model('some_prop'), @dflt)
fn-text:
- name: length
sig: |
<b>length</b>(p: {String|List|Map}) ⇒ Long
synopsis: Returns size or length of the given string, list or map
desc: |
Returns size or length of the given string, list or map. This function has
aliases: <code><b>size</b></code> and <code><b>count</b></code>.
usage: |
// Result: 9
length("some text")
// Result: 3
@lst = list(1, 2, 3)
size(@lst)
count(@lst)
- name: regex
sig: |
<b>regex</b>(s: String, rx: String) ⇒ Boolean
synopsis: Checks whether string <code>s</code> matches Java regular expression <code>rx</code>
desc: |
Returns <code>true</code> if string <code><b>s</b></code> matches Java regular expression <code><b>rx</b></code>,
<code>false</code> otherwise.
usage: |
regex('textabc', '^text.*$') // Returns 'true'.
regex('_textabc', '^text.*$') // Returns 'false'.
- name: trim
sig: |
<b>trim</b>(p: String) ⇒ Long
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#trim()"><code>String.trim()</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#trim()"><code>String.trim()</code></a> on
given parameter <code><b>p</b></code> and returns its result. This function has alias: <code><b>strip</b></code>
usage: |
// Result: "text"
trim(" text ")
strip(" text ")
- name: uppercase
sig: |
<b>uppercase</b>(p: String) ⇒ String
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#toUpperCase()"><code>String.toUpperCase()</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#toUpperCase()"><code>String.toUpperCase()</code></a>
on given parameter <code><b>p</b></code> and returns its result.
usage: |
// Result: "TEXT"
uppercase("text")
- name: lowercase
sig: |
<b>lowercase</b>(p: String) ⇒ String
synopsis: Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#toLowerCase()"><code>String.toLowerCase()</code></a>
desc: |
Calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#toLowerCase()"><code>String.toLowerCase()</code></a>
on given parameter <code><b>p</b></code> and returns its result.
usage: |
// Result: "text"
lowercase("TeXt")
- name: is_alpha
sig: |
<b>is_alpha</b>(p: String) ⇒ Boolean
synopsis: Calls <a target="javadoc" href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isAlpha-java.lang.CharSequence-"><code>StringUtils.isAlpha()</code></a>
desc: |
Calls <a target="asf" href="https://commons.apache.org/">Apache Commons</a> <a target="javadoc" href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isAlpha-java.lang.CharSequence-"><code>StringUtils.isAlpha()</code></a>
on given parameter <code><b>p</b></code> and returns its result.
usage: |
// Result: true
is_alpha("text")
- name: is_alphanum
sig: |
<b>is_alphanum</b>(p: String) ⇒ Boolean
synopsis: Calls <a target="javadoc" href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isAlphanumeric-java.lang.CharSequence-"><code>StringUtils.isAlphanumeric()</code></a>
desc: |
Calls <a target="asf" href="https://commons.apache.org/">Apache Commons</a> <a target="javadoc" href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isAlphanumeric-java.lang.CharSequence-"><code>StringUtils.isAlphanumeric()</code></a>
on given parameter <code><b>p</b></code> and returns its result.
usage: |
// Result: true
is_alphanum("text123")
- name: is_whitespace
sig: |
<b>is_whitespace</b>(p: String) ⇒ Boolean
synopsis: Calls <a target="javadoc" href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isWhitespace-java.lang.CharSequence-"><code>StringUtils.isWhitespace()</code></a>
desc: |
Calls <a target="asf" href="https://commons.apache.org/">Apache Commons</a> <a target="javadoc" href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isWhitespace-java.lang.CharSequence-"><code>StringUtils.isWhitespace()</code></a>
on given parameter <code><b>p</b></code> and returns its result.
usage: |
// Result: false
is_whitespace("text123")
// Result: true
is_whitespace(" ")
- name: is_num
sig: |
<b>is_num</b>(p: String) ⇒ Boolean
synopsis: Calls <a target="javadoc" href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isNumeric-java.lang.CharSequence-"><code>StringUtils.isNumeric()</code></a>
desc: |
Calls <a target="asf" href="https://commons.apache.org/">Apache Commons</a> <a target="javadoc" href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isNumeric-java.lang.CharSequence-"><code>StringUtils.isNumeric()</code></a>
on given parameter <code><b>p</b></code> and returns its result.
usage: |
// Result: true
is_num("123")
- name: is_numspace
sig: |
<b>is_numspace</b>(p: String) ⇒ Boolean
synopsis: Calls <a target="javadoc" href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isNumericSpace-java.lang.CharSequence-"><code>StringUtils.isNumericSpace()</code></a>
desc: |
Calls <a target="asf" href="https://commons.apache.org/">Apache Commons</a> <a target="javadoc" href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isNumericSpace-java.lang.CharSequence-"><code>StringUtils.isNumericSpace()</code></a>
on given parameter <code><b>p</b></code> and returns its result.
usage: |
// Result: true
is_numspace(" 123")
- name: is_alphaspace
sig: |
<b>is_alphaspace</b>(p: String) ⇒ Boolean
synopsis: Calls <a target="javadoc" href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isAlphaSpace-java.lang.CharSequence-"><code>StringUtils.isAlphaSpace()</code></a>
desc: |
Calls <a target="asf" href="https://commons.apache.org/">Apache Commons</a> <a target="javadoc" href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isAlphaSpace-java.lang.CharSequence-"><code>StringUtils.isAlphaSpace()</code></a>
on given parameter <code><b>p</b></code> and returns its result.
usage: |
// Result: true
is_alphaspace(" text ")
- name: is_alphanumspace
sig: |
<b>is_alphanumspace</b>(p: String) ⇒ Boolean
synopsis: Calls <a target="javadoc" href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isAlphaNumericSpace-java.lang.CharSequence-"><code>StringUtils.isAlphaNumericSpace()</code></a>
desc: |
Calls <a target="asf" href="https://commons.apache.org/">Apache Commons</a> <a target="javadoc" href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isAlphaNumericSpace-java.lang.CharSequence-"><code>StringUtils.isAlphaNumericSpace()</code></a>
on given parameter <code><b>p</b></code> and returns its result.
usage: |
// Result: true
is_alphanumspace(" 123 text ")
- name: split
sig: |
<b>split</b>(p1: String, p2: String) ⇒ List[String]
synopsis: Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#split(java.lang.String)"><code>split(<b>p2</b>)</code></a>
desc: |
Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#split(java.lang.String)"><code>split(<b>p2</b>)</code></a>
and returns its result converted to the list.
usage: |
// Result: [ "a", "b", "c" ]
split("a|b|c", "|")
- name: split_trim
sig: |
<b>split_trim</b>(p1: String, p2: String) ⇒ List[String]
synopsis: Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#split(java.lang.String)"><code>split(<b>p2</b>)</code></a>
desc: |
Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#split(java.lang.String)"><code>split(<b>p2</b>)</code></a>
converting the result to the list. Then
calls <a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#strip()">String.strip()</a> on each
element.
usage: |
// Result: ["a", "b", "c"]
split_trim("a | b | c", "|")
- name: starts_with
sig: |
<b>starts_with</b>(p1: String, p2: String) ⇒ Boolean
synopsis: Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#split(java.lang.String)"><code>startsWith(<b>p2</b>)</code></a>
desc: |
Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#split(java.lang.String)"><code>startsWith(<b>p2</b>)</code></a>
and returns its result.
usage: |
// Result: true
starts_width("abc", "ab")
- name: ends_with
sig: |
<b>ends_with</b>(p1: String, p2: String) ⇒ Boolean
synopsis: Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#split(java.lang.String)"><code>endsWith(<b>p2</b>)</code></a>
desc: |
Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#split(java.lang.String)"><code>endsWith(<b>p2</b>)</code></a>
and returns its result.
usage: |
// Result: true
ends_width("abc", "bc")
- name: contains
sig: |
<b>contains</b>(p1: String, p2: String) ⇒ Boolean
synopsis: Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#contains(java.lang.CharSequence)"><code>contains(<b>p2</b>)</code></a>
desc: |
Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#contains(java.lang.CharSequence)"><code>contains(<b>p2</b>)</code></a>
and returns its result.
usage: |
// Result: true
contains("abc", "bc")
- name: index_of
sig: |
<b>index_of</b>(p1: String, p2: String) ⇒ Long
synopsis: Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#indexOf(java.lang.String)"><code>indexOf(<b>p2</b>)</code></a>
desc: |
Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#indexOf(java.lang.String)"><code>indexOf(<b>p2</b>)</code></a>
and returns its result.
usage: |
// Result: 1
index_of("abc", "bc")
- name: substr
sig: |
<b>substr</b>(p1: String, p2: Long, p3: Long) ⇒ String
synopsis: Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#substring(int,int)"><code>substring(<b>p2</b>, <b>p3</b>)</code></a>
desc: |
Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#substring(int,int)"><code>substring(<b>p2</b>, <b>p3</b>)</code></a>
and returns its result.
usage: |
// Result: "bc"
substr("abc", 1, 3)
- name: replace
sig: |
<b>replace</b>(p1: String, p2: String, p3: String) ⇒ String
synopsis: Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#replace(java.lang.CharSequence,java.lang.CharSequence)"><code>replace(<b>p2</b>, <b>p3</b>)</code></a>
desc: |
Calls <code><b>p1</b></code>.<a target="javadoc" href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#replace(java.lang.CharSequence,java.lang.CharSequence)"><code>replace(<b>p2</b>, <b>p3</b>)</code></a>
and returns its result.
usage: |
// Result: "aBC"
replace("abc", "bc", "BC")
- name: to_double
sig: |
<b>to_double</b>(p1: {Long|String}) ⇒ Double
synopsis: Converts given integer or string to double value
desc: |
Converts given integer or string to double value.
usage: |
// Result: 1.2
to_double("1.2")
// Result: 1.0
to_double(1)
- name: to_int
sig: |
<b>to_int</b>(p1: {Double|String}) ⇒ Long
synopsis: Converts given double or string to integer value
desc: |
Converts given double or string to integer value. In case of double
value it will be rounded to the nearest integer value.
usage: |
// Result: 1
to_int("1.2")
to_int(1.2)