func (n *NGramModel) ReadClassDef(filename String) bool {
	ret := pocketsphinx.NgramModelReadClassdef(n.n, filename.S())
	return ret == 0
}
ReadClassDef reads a class definition file and add classes to a language model.

This function assumes that the class tags have already been defined
as unigrams in the language model. All words in the class
definition will be added to the vocabulary as special in-class words.
For this reason is is necessary that they not have the same names
as any words in the general unigram distribution. The convention
is to suffix them with ":class_tag", where class_tag is the class
tag minus the enclosing square brackets.
package sphinx
import (
	"fmt"
	"github.com/xlab/pocketsphinx-go/pocketsphinx"
)
type NGramModel struct {
	n *pocketsphinx.NgramModel
}
func (n *NGramModel) NGramModel() *pocketsphinx.NgramModel {
	return pocketsphinx.NgramModelRetain(n.n)
}
type NGramOptions struct {
	opt       map[String]interface{}
	evaluated *pocketsphinx.CommandLn
}
func (n *NGramOptions) CommandLn() *pocketsphinx.CommandLn {
	if n.evaluated != nil {
		return n.evaluated
	}
	defn := pocketsphinx.Args()
	prevLn := pocketsphinx.CommandLnParseR(nil, defn, 0, nil, 0)
	n.evaluated = optToCommandLn(prevLn, n.opt)
	return n.evaluated
}
func (n *NGramOptions) Destroy() bool {
	if n.evaluated != nil {
		ret := pocketsphinx.CommandLnFreeR(n.evaluated)
		n.evaluated = nil
		return ret == 0
	}
	return true
}
func (n *NGramOptions) MMap(v bool) {
	if n.opt == nil {
		n.opt = make(map[String]interface{})
	}
	n.opt[String("-mmap")] = v
}
func (n *NGramOptions) LanguageWeight(v float32) {
	if n.opt == nil {
		n.opt = make(map[String]interface{})
	}
	n.opt[String("-lw")] = v
}
func (n *NGramOptions) WordInsertionPenalty(v float32) {
	if n.opt == nil {
		n.opt = make(map[String]interface{})
	}
	n.opt[String("-wip")] = v
}
func NewNGramModel(fileName String, fileType NGramFileType,
	lmath *LogMath, opt ...NGramOptions) (*NGramModel, error) {
	ftype := (pocketsphinx.NgramFileType)(fileType)
	if len(opt) > 0 {
		m := pocketsphinx.NgramModelRead(opt[0].CommandLn(), fileName.S(), ftype, lmath.m)
		if m == nil {
			err := fmt.Errorf("sphinx: failed to load n-gram model from %s", fileName)
			return nil, err
		}
		ngram := &NGramModel{
			n: m,
		}
		return ngram, nil
	}
	m := pocketsphinx.NgramModelRead(nil, fileName.S(), ftype, lmath.m)
	if m == nil {
		err := fmt.Errorf("sphinx: failed to load n-gram model from %s", fileName)
		return nil, err
	}
	ngram := &NGramModel{
		n: m,
	}
	return ngram, nil
}
func (n *NGramModel) Destroy() bool {
	if n.n != nil {
		ret := pocketsphinx.NgramModelFree(n.n)
		n.n = nil
		return ret == 0
	}
	return true
}
func (n *NGramModel) Retain() {
	n.n = pocketsphinx.NgramModelRetain(n.n)
}
type NGramFileType int32
const (
	NGramInvalid NGramFileType = NGramFileType(pocketsphinx.NgramInvalid)
	NGramAuto NGramFileType = NGramFileType(pocketsphinx.NgramAuto)
	NGramArpa NGramFileType = NGramFileType(pocketsphinx.NgramArpa)
	NGramBin NGramFileType = NGramFileType(pocketsphinx.NgramBin)
)
type NGramCase int32
const (
	NGramUpper NGramCase = NGramCase(pocketsphinx.NgramUpper)
	NGramLower NGramCase = NGramCase(pocketsphinx.NgramLower)
)
func (n *NGramModel) CaseFold(c NGramCase) bool {
	ret := pocketsphinx.NgramModelCasefold(n.n, int32(c))
	return ret == 0
}
func (n *NGramModel) WriteTo(filename String, format NGramFileType) bool {
	ret := pocketsphinx.NgramModelWrite(n.n, filename.S(), (pocketsphinx.NgramFileType)(format))
	return ret == 0
}
func (n *NGramModel) ApplyWeights(langWeight, insertionPenalty float32) bool {
	ret := pocketsphinx.NgramModelApplyWeights(n.n, langWeight, insertionPenalty)
	return ret == 0
}
func (n *NGramModel) Weights() (langWeight float32, wipLog int32) {
	langWeight = pocketsphinx.NgramModelGetWeights(n.n, &wipLog)
	return
}
func (n *NGramModel) TrigramScore(w3, w2, w1 int32) (score, nUsed int32) {
	score = pocketsphinx.NgramTgScore(n.n, w3, w2, w1, &nUsed)
	return
}
func (n *NGramModel) BigramScore(w2, w1 int32) (score, nUsed int32) {
	score = pocketsphinx.NgramBgScore(n.n, w2, w1, &nUsed)
	return
}
func (n *NGramModel) Score(wordID int32, history []int32) (score, nUsed int32) {
	score = pocketsphinx.NgramNgScore(n.n, wordID, history, int32(len(history)), &nUsed)
	return
}
func (n *NGramModel) Probability(words Strings) int32 {
	return pocketsphinx.NgramProb(n.n, words.S(), int32(len(words)))
}
func (n *NGramModel) QuickProbability(wordID int32, history []int32) (prob, nUsed int32) {
	prob = pocketsphinx.NgramNgProb(n.n, wordID, history, int32(len(history)), &nUsed)
	return
}
func (n *NGramModel) ScoreToProbability(score int32) int32 {
	return pocketsphinx.NgramScoreToProb(n.n, score)
}
func (n *NGramModel) WordID(word String) int32 {
	return pocketsphinx.NgramWid(n.n, word.S())
}
func (n *NGramModel) Word(wordID int32) string {
	return pocketsphinx.NgramWord(n.n, wordID)
}
func (n *NGramModel) UnknownWordID() int32 {
	return pocketsphinx.NgramUnknownWid(n.n)
}
var NGgramInvalidWordID int32 = pocketsphinx.NgramInvalidWid
func (n *NGramModel) Zero() int32 {
	return pocketsphinx.NgramZero(n.n)
}
func (n *NGramModel) Size() int32 {
	return pocketsphinx.NgramModelGetSize(n.n)
}
func (n *NGramModel) Counts() []uint32 {
	return pocketsphinx.NgramModelGetCounts(n.n)
}
func (n *NGramModel) AddWord(word String, weight float32) int32 {
	id := pocketsphinx.NgramModelAddWord(n.n, word.S(), weight)
	return id
}