tochunk

Purpose

Converts the argument to a chunk it is found in or intersects with.

Syntax

tochunk([chunk_type], $group)

Arguments

The first optional argument chunk_type specifies the chunk type and accepts the values listed below:

Chunk type

Comments

np

noun phrase

vp

verb phrase

jp

adjectival phrase

pp

prepositional phrase

rp

adverbial phrase

If the argument is not specified, all chunk types are found.

The second required argument is a reference to a named group a user wants to format. If the argument does not constitute a chunk, the function returns it without changing.

The function also takes the following optional named parameters:

Parameter

Comments

match:=range/arguments

If arguments are discontinuous and they are extracted within several sentences, only these sentences appear in the result. When the optional named parameter match:=range is switched on, the argument is converted to the whole text fragment from the first sentence till the last one.

separator:=<string>

The user can indicate a custom separator. If it is not specified, default separator ";" is used.

level:=top/low

The argument is converted to a chunk of a higher/lower level. Set to "low" by default.

Returned Value

The returned data type is string.

Examples

tochunk($m) the argument is converted to any chunk the named group is found in or intersects with.

tochunk(VP, $m) the argument is converted to a verb chunk the named group is found in or intersects with.

tochunk(NP, $m, level:=top) the argument is converted to a noun chunk of a higher level the named group is found in or intersects with..

tochunk(JP, $m, match:=range) the argument is converted to an adjectival chunk where the named group is found, from the first sentence till the last one or intersects with.