# horizon: Create a function that computes linguistic horizons In beerda/lfl: Linguistic Fuzzy Logic

## Description

Based on given `context` and `atomic` expression, this function returns a function that computes a linguistic horizon, i.e. a triangular function representing basic limits of what humans treat as "small", "medium", "big" etc. within given `context`. Linguistic horizon stands as a base for creation of linguistic expressions. A linguistic expression is created by applying a `hedge()` on horizon. (Atomic linguistic expression is created from horizon by applying an empty (`-`) hedge).

## Usage

 ```1 2 3 4 5``` ```horizon( context, atomic = c("sm", "me", "bi", "lm", "um", "ze", "neg.sm", "neg.me", "neg.bi", "neg.lm", "neg.um") ) ```

## Arguments

 `context` A context of linguistic expressions (see `ctx3()`, `ctx5()`, `ctx3bilat()` or `ctx5bilat()`) `atomic` An atomic expression whose horizon we would like to obtain

## Details

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

• `neg.bi`: big negative (far from zero)

• `neg.um`: upper medium negative (between medium negative and big negative)

• `neg.me`: medium negative

• `neg.lm`: lower medium negative (between medium negative and small negative)

• `neg.sm`: small negative (close to zero)

• `ze`: zero

• `sm`: small

• `lm`: lower medium

• `me`: medium

• `um`: upper medium

• `bi`: big

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

• `ctx3()` (trichotomy): small, medium, big;

• `ctx5()` (pentachotomy): small, lower medium, medium, upper medium, big;

• `ctx3bilat()` (bilateral trichotomy): negative big, negative medium, negative small, zero, small, medium, big;

• `ctx5bilat()` (bilateral pentachotomy): negative big, negative medium, negative small, zero, small, medium, big.

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

## Value

A function of single argument that must be a numeric vector

## Author(s)

Michal Burda

`ctx3()`, `ctx5()`, `ctx3bilat()`, `ctx5bilat()`, `hedge()`, `fcut()`, `lcut()`
 ``` 1 2 3 4 5 6 7 8 9 10``` ``` plot(horizon(ctx3(), 'sm'), from=-1, to=2) plot(horizon(ctx3(), 'me'), from=-1, to=2) plot(horizon(ctx3(), 'bi'), from=-1, to=2) a <- horizon(ctx3(), 'sm') plot(a) h <- hedge('ve') plot(h) verySmall <- function(x) h(a(x)) plot(verySmall) ```