00001 /****************************************************************************** 00002 IrstLM: IRST Language Model Toolkit 00003 Copyright (C) 2006 Marcello Federico, ITC-irst Trento, Italy 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 00019 ******************************************************************************/ 00020 00021 // Linear discounting interpolated LMs 00022 00023 00024 //Witten and Bell linear discounting 00025 00026 class linearwb: public mdiadaptlm 00027 { 00028 int prunethresh; 00029 int minfreqthresh; 00030 public: 00031 linearwb(char* ngtfile,int depth=0,int prunefreq=0,TABLETYPE tt=SHIFTBETA_B); 00032 int train(); 00033 int discount(ngram ng,int size,double& fstar,double& lambda,int cv=0); 00034 ~linearwb() {} 00035 }; 00036 00037 00038 00039 //Good Turing linear discounting 00040 00041 //no more supported