hedge: Linguistic hedges

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/hedge.R

Description

Returns a function that realizes linguistic hedging - i.e. transformation of linguistic horizon (see horizon()) into a linguistic expression.

Usage

1
2
3
4
hedge(
  type = c("ex", "si", "ve", "ty", "-", "ml", "ro", "qr", "vr"),
  hedgeParams = defaultHedgeParams
)

Arguments

type

The type of the required linguistic hedge

hedgeParams

Parameters that determine the shape of the hedges

Details

hedge() returns a function that realizes the selected linguistic hedge on its parameter:

This function is quite low-level. Perhaps a more convenient way to create linguistic expressions is to use the lingexpr() function.

Value

Returns a function with a single argument, which has to be a numeric vector.

Author(s)

Michal Burda

See Also

horizon(), lingexpr(), fcut(), lcut(), ctx()

Examples

1
2
3
4
5
6
7
8
9
    a <- horizon(ctx3(), 'sm')
    plot(a)
    h <- hedge('ve')
    plot(h)
    verySmall <- function(x) h(a(x))
    plot(verySmall)

    # the last plot should be equal to:
    plot(lingexpr(ctx3(), atomic='sm', hedge='ve'))

beerda/lfl documentation built on Oct. 17, 2020, 8:57 p.m.