irstlm/src/lmtable.h File Reference

#include <sys/types.h>
#include <sys/mman.h>
#include <math.h>
#include <cstdlib>
#include <string>
#include <set>
#include "util.h"
#include "ngramcache.h"
#include "dictionary.h"
#include "n_gram.h"

Go to the source code of this file.

Classes

class  lmtable

Defines

#define MAX(a, b)   (((a)>(b))?(a):(b))
#define MIN(a, b)   (((a)<(b))?(a):(b))
#define LMTMAXLEV   20
#define MAX_LINE   1024
#define LMTCODESIZE   (int)3
#define SHORTSIZE   (int)2
#define PTRSIZE   (int)sizeof(char *)
#define INTSIZE   (int)4
#define CHARSIZE   (int)1
#define PROBSIZE   (int)4
#define QPROBSIZE   (int)1
#define BOUNDSIZE   (int)sizeof(table_entry_pos_t)
#define UNIGRAM_RESOLUTION   10000000.0
#define BOUND_EMPTY1   (numeric_limits<table_entry_pos_t>::max() - 2)
#define BOUND_EMPTY2   (numeric_limits<table_entry_pos_t>::max() - 1)

Typedefs

typedef char * node
typedef unsigned int table_entry_pos_t
typedef unsigned long table_pos_t
typedef unsigned char qfloat_t

Enumerations

enum  LMT_TYPE { INTERNAL, QINTERNAL, LEAF, QLEAF }
enum  OUTFILE_TYPE { BINARY, TEXT, YRANIB, NONE }
enum  LMT_ACTION { LMT_FIND, LMT_ENTER, LMT_INIT, LMT_CONT }


Define Documentation

#define BOUND_EMPTY1   (numeric_limits<table_entry_pos_t>::max() - 2)

Definition at line 81 of file lmtable.h.

Referenced by lmtable::add(), lmtable::checkbounds(), and lmtable::get().

#define BOUND_EMPTY2   (numeric_limits<table_entry_pos_t>::max() - 1)

Definition at line 82 of file lmtable.h.

Referenced by lmtable::add(), and lmtable::checkbounds().

#define BOUNDSIZE   (int)sizeof(table_entry_pos_t)

Definition at line 61 of file lmtable.h.

Referenced by lmtable::nodesize().

#define CHARSIZE   (int)1

Definition at line 56 of file lmtable.h.

Referenced by ngramtable::loadbin(), ngramtable::savebin(), and tabletype::tabletype().

#define INTSIZE   (int)4

#define LMTCODESIZE   (int)3

#define LMTMAXLEV   20

Definition at line 46 of file lmtable.h.

Referenced by lmtable::lmtable(), parseline(), and lmtable::~lmtable().

#define MAX ( a,
 )     (((a)>(b))?(a):(b))

Definition at line 41 of file lmtable.h.

Referenced by lmtable::reset_caches().

#define MAX_LINE   1024

Definition at line 47 of file lmtable.h.

Referenced by lmmacro::loadLexicalClasses(), main(), and parseline().

#define MIN ( a,
 )     (((a)<(b))?(a):(b))

Definition at line 42 of file lmtable.h.

Referenced by lmtable::lprob().

#define PROBSIZE   (int)4

Definition at line 58 of file lmtable.h.

Referenced by lmtable::bound(), lmtable::bow(), and lmtable::nodesize().

#define PTRSIZE   (int)sizeof(char *)

Definition at line 54 of file lmtable.h.

Referenced by ngramtable::mtable(), and tabletype::tabletype().

#define QPROBSIZE   (int)1

Definition at line 59 of file lmtable.h.

Referenced by lmtable::bound(), lmtable::bow(), and lmtable::nodesize().

#define SHORTSIZE   (int)2

Definition at line 53 of file lmtable.h.

#define UNIGRAM_RESOLUTION   10000000.0

Definition at line 63 of file lmtable.h.

Referenced by lmtable::lprob(), and lmtable::lprobx().


Typedef Documentation

typedef char* node

Definition at line 67 of file lmtable.h.

typedef unsigned char qfloat_t

Definition at line 77 of file lmtable.h.

typedef unsigned int table_entry_pos_t

Definition at line 75 of file lmtable.h.

typedef unsigned long table_pos_t

Definition at line 76 of file lmtable.h.


Enumeration Type Documentation

enum LMT_ACTION

Enumerator:
LMT_FIND  search: find an entry
LMT_ENTER  search: enter an entry
LMT_INIT  scan: start scan
LMT_CONT  scan: continue scan

Definition at line 69 of file lmtable.h.

enum LMT_TYPE

Enumerator:
INTERNAL 
QINTERNAL 
LEAF 
QLEAF 

Definition at line 65 of file lmtable.h.

Enumerator:
BINARY 
TEXT 
YRANIB 
NONE 

Definition at line 66 of file lmtable.h.


Generated on Fri Apr 15 13:04:15 2011 for Moses by  doxygen 1.5.9