亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pv.c

?? 卡內基梅隆大學MaCallum開發的文本分類系統
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* "Position vector", a (compressed) list of word positions in documents *//* Copyright (C) 1998 Andrew McCallum   Written by:  Andrew Kachites McCallum <mccallum@cs.cmu.edu>   This file is part of the Bag-Of-Words Library, `libbow'.   This library is free software; you can redistribute it and/or   modify it under the terms of the GNU Library General Public License   as published by the Free Software Foundation, version 2.      This library is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU   Library General Public License for more details.   You should have received a copy of the GNU Library General Public   License along with this library; if not, write to the Free Software   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA */#define _FILE_OFFSET_BITS 64#include <bow/libbow.h>#include <bow/archer.h>#define PV_DEBUG 1/* The total amount of memory consumed by PVM's */int bow_pvm_total_bytes = 0;/* The maximum memory we will allow PVM's to take before we flush them   to disk.  Currently set to 128M */int bow_pvm_max_total_bytes = 128 * 1024 * 1024;/* Allocate and return a new PVM that can hold SIZE bytes */bow_pvm *bow_pvm_new (int size){  bow_pvm *ret = bow_malloc (sizeof (bow_pvm) + size);  ret->size = size;  ret->read_end = 0;  ret->write_end = 0;  bow_pvm_total_bytes += sizeof (bow_pvm) + size;  return ret;}/* Increase the capacity of PVM, growing by doubling size until we get   to 128k, then just grow by 128k increments. */voidbow_pvm_grow (bow_pvm **pvm){  if ((*pvm)->size < 64 * 1024)    {      (*pvm)->size *= 2;      bow_pvm_total_bytes += (*pvm)->size;    }  else    {      (*pvm)->size += 64 * 1024;      bow_pvm_total_bytes += 64 * 1024;    }  *pvm = bow_realloc (*pvm, sizeof (bow_pvm) + (*pvm)->size);}/* Free the memory associated with the PVM */voidbow_pvm_free (bow_pvm *pvm){  bow_free (pvm);}/* Put the PVM's reader-pointer back to the beginning */static inline voidbow_pvm_rewind (bow_pvm *pvm){  pvm->read_end = 0;}/* PV functions *//* The first four bytes of a segment are an int that indicate how many   bytes are allocated in this segment.  The last four bytes of a   segment are an int that indicates the seek location of the next   segment.  The read_segment_bytes_remaining does not include   the size of the two int's. *//* Always enough for one "document index"/"word index" pair:   5 bytes == 6+4*7 == 34 bits for di, likewise for pi. */#define bow_pv_max_sizeof_di_pi (2 * 5)static int bow_pv_sizeof_first_segment = 2 * bow_pv_max_sizeof_di_pi;/* Fill in PV with the correct initial values. */voidbow_pv_init (bow_pv *pv, FILE *fp){  //pv->byte_count = 0;  pv->word_count = 0;  //pv->document_count = 0;  pv->pvm = NULL;  pv->seek_start = 0; //-1  pv->read_seek_end = 0;  pv->read_segment_bytes_remaining = -1;  pv->read_last_di = -1;  pv->read_last_pi = -1;  pv->write_last_di = -1;  pv->write_last_pi = -1;  pv->write_seek_last_tailer = 0;	/* This value must match READ_SEEK_END */}/* Write this PV's PVM to disk, and free the PVM. */voidbow_pv_flush (bow_pv *pv, FILE *fp){  off_t seek_new_segment;  off_t seek_new_tailer;  if (pv->pvm == NULL || pv->pvm->write_end == 0)    return;  /* Seek to the end of the file, which is the position at which this     segment of the PV will begin. */  fseeko (fp, 0, SEEK_END);  seek_new_segment = ftello (fp);  /* If none of this PV has ever been written to disk, remember this     position as the start position so that we can rewind there later. */  if (pv->seek_start == 0) //-1    {      pv->seek_start = seek_new_segment;      pv->read_seek_end = seek_new_segment;      pv->read_segment_bytes_remaining = pv->pvm->write_end;    }  /* Write the "header", which is the number of contents data bytes in     this segment. */  bow_fwrite_int (pv->pvm->write_end, fp);  /* Write the contents data */  fwrite (pv->pvm->contents, sizeof (unsigned char), pv->pvm->write_end, fp);  /* Write (a temporary value for) the "tailer".  Later we will put     here the seek position of the next pv segment on disk. */  /* xxx Don't actually need a ftello() here.  Do the math instead. */  seek_new_tailer = ftello (fp);  bow_fwrite_off_t (0, fp); //-1  /* If this is not the first time this PV has been flushed, then     the "tailer" of the previous flushed segment, and write the seek     position of this segment there. */  if (pv->write_seek_last_tailer != 0)    {      fseeko (fp, pv->write_seek_last_tailer, SEEK_SET);      bow_fwrite_off_t (seek_new_segment, fp);    }  pv->write_seek_last_tailer = seek_new_tailer;  bow_pvm_total_bytes -= sizeof (bow_pvm) + pv->pvm->size;  bow_pvm_free (pv->pvm);  pv->pvm = NULL;}/* Write to PVM the unsigned integer I, marked with the special flag   saying if it is a DI or a PI, (as indicated by IS_DI).  Assumes   there is enough space there in this PVM to write the info.  Returns   the number of bytes written. */static inline intbow_pvm_write_unsigned_int (bow_pvm *pvm, unsigned int i, int is_di){  bow_pe pe;  int byte_count = 1;		/* Count already the last byte */  /* assert (i < (1 < 6+7+7+7+1)); */  if (is_di)    pe.bits.is_di = 1;  else    pe.bits.is_di = 0;  if (i > 0x3f)			/* binary = 00111111 */    {      pe.bits.is_more = 1;      pe.bits.index = i & 0x3f;	/* binary = 00111111 */      pvm->contents[pvm->write_end++] = pe.byte;  /* Write the first byte */      byte_count++;      i = i >> 6;      while (i > 0x7f)		/* binary = 01111111 */	{	  pe.bits_more.is_more = 1;	  pe.bits_more.index = i & 0x7f;	  pvm->contents[pvm->write_end++] = pe.byte;	  byte_count++;	  i = i >> 7;	}	pe.bits_more.is_more = 0;	pe.bits_more.index = i;	pvm->contents[pvm->write_end++] = pe.byte;    }  else    {      pe.bits.is_more = 0;      pe.bits.index = i;      /* Write the first byte and only */      pvm->contents[pvm->write_end++] = pe.byte;    }  return byte_count;}/* Read an unsigned integer into I, and indicate whether it is a   "document index" or a "position index" by the value of IS_DI.   Returns the number of bytes read. */static inline intbow_pvm_read_unsigned_int (bow_pvm *pvm, unsigned int *i, int *is_di){  bow_pe pe;  int index;  int shift = 6;  int byte_count = 1;  pe.byte = pvm->contents[pvm->read_end++];  if (pe.bits.is_di)    *is_di = 1;  else    *is_di = 0;  index = pe.bits.index;  while (pe.bits.is_more)    /* The above test relies on pe.bits.is_more == pe.bits_more.is_more */    {      pe.byte = pvm->contents[pvm->read_end++];      byte_count++;      index |= pe.bits_more.index << shift;      shift += 7;    }  *i = index;  return byte_count;}/* Read an unsigned integer into I, and indicate whether it is a   "document index" or a "position index" by the value of IS_DI.   Assumes that FP is already seek'ed to the correct position. Returns   the number of bytes read. */static inline intbow_pv_read_unsigned_int (unsigned int *i, int *is_di, FILE *fp){  bow_pe pe;  int index;  int shift = 6;  int byte_count = 1;  pe.byte = fgetc (fp);  if (pe.bits.is_di)    *is_di = 1;  else    *is_di = 0;  index = pe.bits.index;  while (pe.bits.is_more)    /* The above test relies on pe.bits.is_more == pe.bits_more.is_more */    {      pe.byte = fgetc (fp);      byte_count++;      index |= pe.bits_more.index << shift;      shift += 7;    }  *i = index;  return byte_count;}#define PV_WRITE_SIZE_INT(N)			\(((N) < (1 << (6+1)))				\ ? 1						\ : (((N) < (1 << (6+7+1)))			\    ? 2						\    : (((N) < (1 << (6+7+7+1)))			\       ? 3					\       : (((N) < (1 << (6+7+7+7+1)))		\	  ? 4					\	  : 5))))static inline intbow_pv_write_size_di_pi (bow_pv *pv, int di, int pi){

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
最新国产成人在线观看| 麻豆成人免费电影| 久久久久久久电影| 欧美精品一区二区久久久| 欧美一区二区在线免费观看| 91.麻豆视频| 亚洲精品一区二区三区香蕉| 欧美大尺度电影在线| 日韩一区二区在线观看视频播放| 日本二三区不卡| 5月丁香婷婷综合| 国产精品青草综合久久久久99| 久久久久9999亚洲精品| 亚洲裸体xxx| 久久精品国产亚洲高清剧情介绍| 国产成人99久久亚洲综合精品| 91丨porny丨中文| 国产精品毛片高清在线完整版| 日韩网站在线看片你懂的| 中文字幕制服丝袜成人av| 亚洲国产另类精品专区| 成人爽a毛片一区二区免费| 91理论电影在线观看| 精品少妇一区二区三区在线播放| 中文字幕乱码亚洲精品一区 | 激情国产一区二区| 99国产精品国产精品久久| 欧美xxxxxxxxx| 男女性色大片免费观看一区二区| 91影视在线播放| 亚洲人妖av一区二区| 国模冰冰炮一区二区| 91精品婷婷国产综合久久竹菊| 中文字幕视频一区二区三区久| 美女mm1313爽爽久久久蜜臀| 欧美无人高清视频在线观看| 亚洲男人的天堂在线观看| 成人黄色在线看| 一区在线播放视频| 欧洲精品一区二区| 日韩综合小视频| www国产精品av| 国产麻豆欧美日韩一区| 久久久久成人黄色影片| 91在线观看视频| 亚洲国产日韩av| 精品国产一区二区三区不卡| 国产九色精品成人porny| 国产农村妇女精品| av电影在线观看完整版一区二区| 亚洲欧美日韩中文字幕一区二区三区| 亚洲欧美电影一区二区| 日本色综合中文字幕| 欧美一区二区三区喷汁尤物| 激情综合色播五月| 亚洲欧美日韩国产综合在线| 在线免费观看不卡av| 日本在线播放一区二区三区| 中文字幕av免费专区久久| 在线观看视频一区| 成人精品鲁一区一区二区| 婷婷久久综合九色国产成人| 国产精品久久毛片a| 亚洲精品一区在线观看| 欧美久久久一区| 在线观看亚洲a| 欧美在线观看视频一区二区三区| 国产精品888| 激情五月婷婷综合| 秋霞成人午夜伦在线观看| 亚洲日本在线观看| 中文字幕电影一区| 国产日本亚洲高清| 欧美激情在线看| 自拍偷拍国产精品| 亚洲女爱视频在线| 亚洲第一福利一区| 午夜欧美电影在线观看| 日韩 欧美一区二区三区| 另类小说一区二区三区| av日韩在线网站| 国产麻豆成人传媒免费观看| 九九视频精品免费| 国产精品 欧美精品| 97久久超碰国产精品| 69堂国产成人免费视频| 日韩欧美国产麻豆| 国产校园另类小说区| 亚洲视频一二区| 日韩av高清在线观看| 国产麻豆成人精品| 欧美日韩一区国产| 欧美一区二区播放| 亚洲视频一二三| 美女视频黄免费的久久| 成av人片一区二区| 欧美一区二区美女| 国产精品国产三级国产a| 美女免费视频一区二区| 日本乱人伦aⅴ精品| 久久精品亚洲国产奇米99| 香蕉影视欧美成人| 91网站最新地址| 国产精品日产欧美久久久久| 久久精品国产精品亚洲红杏| 欧美丰满高潮xxxx喷水动漫| 日韩理论片网站| 成人动漫在线一区| 亚洲欧洲精品一区二区精品久久久| 九九在线精品视频| 国产视频911| 成人黄色网址在线观看| 欧美成人三级在线| 亚洲欧美偷拍卡通变态| 1024成人网| 亚洲成人黄色影院| 成人av在线资源| 日韩毛片高清在线播放| 成人毛片在线观看| 中文字幕日本不卡| 欧美伊人久久久久久午夜久久久久| 日本一区二区不卡视频| 91欧美激情一区二区三区成人| 国产精品毛片久久久久久久| 蜜臀va亚洲va欧美va天堂| 久久久久久一二三区| 成人app网站| 久久国产尿小便嘘嘘| 日本一区二区电影| 欧美一级日韩不卡播放免费| 国产一区在线看| 亚洲乱码国产乱码精品精小说 | 日韩伦理免费电影| 欧美日韩小视频| av不卡一区二区三区| 美洲天堂一区二卡三卡四卡视频| 日本一区二区三区在线不卡 | 国产精品三级av在线播放| 这里只有精品免费| 色狠狠av一区二区三区| 国产原创一区二区三区| 亚欧色一区w666天堂| 亚洲欧美中日韩| 国产精品视频一二三区| 久久综合狠狠综合久久综合88| 欧美少妇xxx| 一本久久精品一区二区| 91在线视频网址| 成人午夜精品一区二区三区| 麻豆中文一区二区| 香蕉加勒比综合久久| 亚洲一区二三区| 亚洲一区二区中文在线| 午夜久久久久久久久 | 99久久综合国产精品| 国产一区二区三区日韩| 国产乱人伦精品一区二区在线观看| 伦理电影国产精品| 国产不卡免费视频| 成人毛片在线观看| 欧美伊人久久久久久久久影院 | 亚洲视频免费观看| 亚洲电影第三页| 国产aⅴ精品一区二区三区色成熟| 懂色av中文一区二区三区| a级精品国产片在线观看| 色婷婷综合在线| 久久免费偷拍视频| 一区二区三区久久| 国产精品中文字幕一区二区三区| 成人亚洲一区二区一| 777欧美精品| 伊人性伊人情综合网| 北岛玲一区二区三区四区| 欧美日韩大陆一区二区| 亚洲图片激情小说| av男人天堂一区| 激情五月婷婷综合网| 中文字幕中文字幕一区二区| 亚洲国产精品欧美一二99| 精品一区二区三区免费视频| 91久久一区二区| 亚洲欧洲制服丝袜| 91视频国产观看| 国产女人aaa级久久久级| 国产乱国产乱300精品| 欧美大片一区二区| 狠狠色综合播放一区二区| 欧美人xxxx| 麻豆精品在线看| 精品sm捆绑视频| 国产乱码精品1区2区3区| 精品国产污污免费网站入口| 丝袜美腿一区二区三区| 欧美人与z0zoxxxx视频| 日本不卡视频在线| 国产午夜精品一区二区三区嫩草 | 国产日韩欧美电影| gogo大胆日本视频一区| 一区二区三区免费在线观看|