nulllm.h

来自「这是一款很好用的工具包」· C头文件 代码 · 共 34 行

H
34
字号
/* * NullLM.h *	The Null Language Model * * This model always computes a constant log probability of zero. * It is thus not a real model, but it can be used as a dummy when * an LM should not perform any real function. * * Copyright (c) 1995,2002 SRI International.  All Rights Reserved. * * @(#)$Header: /home/srilm/devel/lm/src/RCS/NullLM.h,v 1.3 2002/08/25 17:27:45 stolcke Exp $ * */#ifndef _NullLM_h_#define _NullLM_h_#include "LM.h"class NullLM: public LM{public:    NullLM(Vocab &vocab) : LM(vocab) {};    LogP wordProb(VocabIndex word, const VocabIndex *context)	{ return 0.0; }    void *contextID(VocabIndex word, const VocabIndex *context,							unsigned &length)	{ length = 0; return (void *)1; };};#endif /* _NullLM_h_ */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?