get_weight: Get weight

Description Usage Arguments Value

View source: R/get-weight.R

Description

Gets the weight (or count) of a given n-gram in a trained PPM moel.

Usage

1
2
get_weight(model, n_gram, pos = 1L, time = 0,
  update_excluded = FALSE, zero_indexed = FALSE)

Arguments

model

A PPM model object as produced by (for example) new_ppm_simple or new_ppm_decay.

n_gram

An integerish vector defining the n-gram to be queried.

pos

(Integerish scalar) The nominal 'position' at which the n-gram is retrieved (only relevant for decay-based models).

time

(Numeric scalar) The nominal 'time' at which the n-gram is retrieved (only relevant for decay-based models).

update_excluded

(Logical scalar) Whether to retrieve update-excluded counts or not.

zero_indexed

(Logical scalar) Whether the input n-gram is zero-indexed.

Value

A numeric scalar identifying the weight of the n-gram.


pmcharrison/ppm documentation built on Jan. 13, 2020, 3:57 p.m.