Sdílet prostřednictvím


ClassLanguageModel Class

Implements

java.lang.AutoCloseable

public final class ClassLanguageModel
extends Grammar
implements java.lang.AutoCloseable

Represents a ClassLanguageModel. ClassLanguageModels are only usable in specific scenarios and are not generally available. Note: close() must be called in order to release underlying resources held by the object. Added in version 1.7.0

Method Summary

Modifier and Type Method and Description
void assignClass(String className, Grammar grammar)

Assigns a grammar to a specified class in a language model.

static ClassLanguageModel fromStorageId(String id)

Creates a classLanguageModel from its storage Id.

Methods inherited from Grammar

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Method Details

assignClass

public void assignClass(String className, Grammar grammar)

Assigns a grammar to a specified class in a language model.

Parameters:

className - The name of a class in the language model.
grammar - The grammar to associate with the class.

fromStorageId

public static ClassLanguageModel fromStorageId(String id)

Creates a classLanguageModel from its storage Id. Creating a ClassLanguageModel from a storage ID is only usable in specific scenarios and is not generally available.

Parameters:

id - The Id of the Class Language Model

Returns:

classLanguageModel associated with the given Id.

Applies to