concat

Purpose

Joins arguments values (named groups or constants) into one string.

Syntax

concat($group, $group)

or

concat(string, string)

or

concat($group, string, $group)

Arguments

Requires two or more arguments of a string value (named groups or constants).

The function also supports a named parameter allow_empty:=yes/no which specifies whether to produce an output if one or more argument is empty (set to "no" by default). By default, the function returns empty string if one or more argument are empty.

Returned Value

A single string value containing all the arguments.

By default, the function joins argument values without any delimiter between them. To get arguments separated by a delimiter, pass delimiters as function arguments at the positions where they should be placed.

For example, concat(A, " ", B) returns "A B".

The delimiter value can be arbitrary string and should be enclosed in quotes if it contains special characters or punctuation signs, such as " ", ":", ",".

Examples

Dataset

XPDL-rule

Result

Attribute

I eat ice-cream every day.

rule: r1

{

query: {phrase(2,{stem(pronoun)}:2, lemma(verb), {stem(ice-cream)}:3)}:1

result: Match = $1

attribute: Attribute = concat($2, " ", $3)

}

I eat ice-cream

I ice-cream

She eats ice-cream every day.

She eats ice-cream

She ice-cream

He ate two ice-creams.

He ate ice-creams

He ice-creams