⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vocabmultimap.h

📁 这是一款很好用的工具包
💻 H
字号:
/* * VocabMultiMap.h -- *	Probabilistic mappings between a vocabulary and strings from *	another vocabulary (as in dictionaries). * * Copyright (c) 2000 SRI International.  All Rights Reserved. * * @(#)$Header: /home/srilm/devel/lm/src/RCS/VocabMultiMap.h,v 1.2 2001/05/21 17:13:51 stolcke Exp $ * */#ifndef _VocabMultiMap_h_#define _VocabMultiMap_h_#include "Boolean.h"#include "Prob.h"#include "Vocab.h"#include "Map2.h"class VocabMultiMap{    friend class VocabMultiMapIter;public:    VocabMultiMap(Vocab &v1, Vocab &v2, Boolean logmap = false);        Prob get(VocabIndex w1, const VocabIndex *w2);    void put(VocabIndex w1, const VocabIndex *w2, Prob prob);    void remove(VocabIndex w1, const VocabIndex *w2);    virtual Boolean read(File &file);    virtual Boolean write(File &file);        Vocab &vocab1;    Vocab &vocab2;private:    /*     * The map is implemented by a two-level map where the first index is     * from vocab1 and the second from strings over vocab2     */    Map2<VocabIndex,const VocabIndex *,Prob> map;    Boolean logmap;			/* treat probabilities as log probs */};/* * Iteration over the mappings of a word */class VocabMultiMapIter{public:    VocabMultiMapIter(VocabMultiMap &vmap, VocabIndex w);    void init();    const VocabIndex *next(Prob &prob);private:    Map2Iter2<VocabIndex,const VocabIndex *,Prob> mapIter;};#endif /* _VocabMultiMap_h_ */

⌨️ 快捷键说明

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