nbestset.h

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

H
77
字号
/* * NBestSet.h -- *	Sets of N-best lists * * Copyright (c) 1998,2002 SRI International.  All Rights Reserved. * * @(#)$Header: /home/srilm/devel/lm/src/RCS/NBestSet.h,v 1.6 2006/01/05 20:21:27 stolcke Exp $ * */#ifndef _NBestSet_h_#define _NBestSet_h_#include <iostream>using namespace std;#include <string.h>#include "Boolean.h"#include "File.h"#include "Vocab.h"#include "LHash.h"#include "NBest.h"#include "RefList.h"#include "Debug.h"/* * An element of the NBest set: an NBest List and associated information */typedef struct {    const char *filename;    NBestList *nbest;} NBestSetElement;class NBestSet: public Debug{    friend class NBestSetIter;public:    NBestSet(Vocab &vocab, RefList &refs, unsigned maxNbest = 0,		    Boolean incremental = false, Boolean multiwords = false);    ~NBestSet();    Boolean read(File &file);    unsigned numElements() { return lists.numEntries(); };    Vocab &vocab;    Boolean warn;private:    unsigned maxNbest;    Boolean incremental;    Boolean multiwords;    RefList &refs;    LHash<RefString,NBestSetElement> lists;    Boolean readList(RefString id, NBestSetElement &elt);    void freeList(NBestSetElement &elt);};class NBestSetIter{public:    NBestSetIter(NBestSet &set);    void init();    NBestList *next(RefString &id);    const char *nextFile(RefString &id);private:    NBestSet &mySet;    LHashIter<RefString,NBestSetElement> myIter;    NBestSetElement *lastElt;};#endif /* _NBestSet_h_ */

⌨️ 快捷键说明

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