这是一款很好用的工具包

源代码在线查看: make-abs-discount.gawk

软件大小: 3034 K
上传用户: wanghaihah
关键词: 工具包
下载地址: 免注册下载 普通下载 VIP

相关代码

				#!/usr/local/bin/gawk -f				#				# make-abs-discount --				#	computes the absolute (constant) discount values from Good-Turing				#	counts-of-counts statistics.  (Only the n1 and n2 statistics are used.)				#				# usage: make-abs-discount COUNTFILE				#				# 	where COUNTFILE was created with get-gt-counts.				#				# $Header: /home/srilm/devel/utils/src/RCS/make-abs-discount.gawk,v 1.2 2004/11/02 02:00:35 stolcke Exp $				#				$1 == 1 {					gt1count = $2;				}				$1 == 2 {					gt2count = $2;				}				END {					if (gt1count == 0) {						print "n1 count is zero" >> "/dev/stderr";						exit 1;					}					if (gt2count == 0) {						print "n2 count is zero" >> "/dev/stderr";						exit 1;					}					print gt1count/(gt1count + 2 * gt2count);				}											

相关资源