Learn R Programming

lfl (version 2.2.0)

hedge: Linguistic hedges

Description

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

Usage

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

Value

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

Arguments

type

The type of the required linguistic hedge

hedgeParams

Parameters that determine the shape of the hedges

Author

Michal Burda

Details

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

  • ex: extremely,

  • si: significantly,

  • ve: very,

  • ty: typically,

  • -: empty hedge (no hedging),

  • ml: more or less,

  • ro: roughly,

  • qr: quite roughly,

  • vr: very roughly.

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

See Also

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

Examples

Run this code
    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'))

Run the code above in your browser using DataLab