lingexpr: Creator of functions representing linguistic expressions

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

View source: R/lingexpr.R

Description

A linguistic expression represents vague human terms such as "very small", "extremely big" etc. Such notions are always reasoned within a given context. lingexpr returns a function that models a selected linguistic expression. Accordingly to the given context, atomic expression (such as "small", "big") and a linguistic hedge (such as very, extremely), the returned function transforms numeric values into degrees (from [0, 1] interval), at which the values correspond to the expression.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
lingexpr(
  context,
  atomic = c("sm", "me", "bi", "lm", "um", "ze", "neg.sm", "neg.me", "neg.bi",
    "neg.lm", "neg.um"),
  hedge = c("ex", "si", "ve", "ty", "-", "ml", "ro", "qr", "vr"),
  negated = FALSE,
  hedgeParams = defaultHedgeParams
)

allowed.lingexpr

Arguments

context

A context of linguistic expressions (see ctx3(), ctx5(), ctx3bilat() or ctx5bilat())

atomic

An atomic expression whose horizon we would like to obtain

hedge

The type of the required linguistic hedge ('-' for no hedging)

negated

Negate the expression? (For instance, "not very small".) Negation is done using the invol.neg() function.

hedgeParams

Parameters that determine the shape of the hedges

Format

An object of class matrix (inherits from array) with 9 rows and 11 columns.

Details

Based on the context type, the following atomic expressions are allowed:

The values of the atomic parameter have the following meaning (in ascending order):

hedge parameter has the following meaning:

Accordingly to the theory of linguistic expressions by Novak, not every hedge is applicable to each atomic expression. The combinations of allowed pairs can be found in allowed.lingexpr. Trying to create forbidden combination results in error.

Value

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

Author(s)

Michal Burda

See Also

horizon(), hedge(), fcut(), lcut(), ctx()

Examples

1
2
3
4
5
6
7
    small <- lingexpr(ctx3(0, 0.5, 1), atomic='sm', hedge='-')
    small(0)   # 1
    small(0.8) # 0
    plot(small)

    verySmall <- lingexpr(ctx3(0, 0.5, 1), atomic='sm', hedge='ve')
    plot(verySmall)

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