Learn R Programming

flashlighttext (version 0.1.0)

LM: LM

Description

LM

LM

Arguments

Active bindings

ptr

get or set a pointer to a (*)LMWrapper.

Methods


Method new()

Usage

LM$new()

Returns

NULL


Method start()

Usage

LM$start(startWithNothing)

Arguments

startWithNothing

a logical value indicating whether the state should be initialized with a start-of-sequence marker.

Returns

An LMState object representing the current state.


Method score()

Usage

LM$score(state, usrTokenIdx)

Arguments

state

An LMState object representing the current state.

usrTokenIdx

An integer representing the index of the current token in the user-defined token list.

Returns

A list containing the externalpointer to the updated LMState object and a numeric value representing the score.


Method finish()

Usage

LM$finish(state)

Arguments

state

An LMState object representing the current state.

Returns

A list containing the updated LMState object and a numeric value representing the final score.


Method clone()

The objects of this class are cloneable with this method.

Usage

LM$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.