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

📄 t.passthrough-hb

📁 一个C语言写的快速贝叶斯垃圾邮件过滤工具
💻 PASSTHROUGH-HB
字号:
#! /bin/sh. ${srcdir:=.}/t.frame# t.passthrough-hb##	test for correct detection of line separating header and body$BOGOFILTER -e -p -C <${srcdir}/inputs/headerbody.txt >${TMPDIR}/output$AWK '/^X-Bogosity:/ { bl=NR } \      /^Summary:/    { sl=NR } \      END            { if (sl > bl) { exit 1; } }' \  <${TMPDIR}/outputCFG="${TMPDIR}/test.cf"cat >>$CFG <<EOFheader_format = %h: %c, tests=bogofilter, spamicity=%pEOF# test two additional scenarios#	- one with a body#	- one with no bodycat >${TMPDIR}/reference.2 <<EOFHeader: body and empty line head2Another-Header: head3 after non-empty blank -- X-Bogosity should be nextX-Bogosity: Unsure, tests=bogofilter, spamicity=0.520000after empty lineEOFcat >${TMPDIR}/reference.3 <<EOFHeader: no body head2Another-Header: head3 -- X-Bogosity should be nextX-Bogosity: Unsure, tests=bogofilter, spamicity=0.520000after non-empty blank no bodyEOFcat <<EOF |tr "^" "\r" >${TMPDIR}/reference.4Header: no body^ head2^Another-Header: head4 -- X-Bogosity should be next^X-Bogosity: Unsure, tests=bogofilter, spamicity=0.520000^^after non-empty blank^ ^no body^EOFprintf "Header: body and empty line\n head2\nAnother-Header: head3\n \nafter non-empty blank -- X-Bogosity should be next\n\nafter empty line" > ${TMPDIR}/input.2$BOGOFILTER -e -p -c $CFG < ${TMPDIR}/input.2 > ${TMPDIR}/results.2printf "Header: no body\n head2\nAnother-Header: head3 -- X-Bogosity should be next\n \nafter non-empty blank\n \nno body" > ${TMPDIR}/input.3$BOGOFILTER -e -p -c $CFG < ${TMPDIR}/input.3 > ${TMPDIR}/results.3printf "Header: no body\r\n head2\r\nAnother-Header: head4 -- X-Bogosity should be next\r\n \r\nafter non-empty blank\r\n \r\nno body" > ${TMPDIR}/input.4$BOGOFILTER -e -p -c $CFG < ${TMPDIR}/input.4 > ${TMPDIR}/results.4for f in 2 3 4 ; do    if  [ $verbose -eq 0 ]; then	cmp ${TMPDIR}/reference.$f ${TMPDIR}/results.$f    else	set +e	diff $DIFF_BRIEF ${TMPDIR}/reference.$f ${TMPDIR}/results.$f    fidone

⌨️ 快捷键说明

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