Julius 4.2
関数 | 変数
libsent/src/ngram/ngram_read_arpa.c

ARPA形式のN-gramファイルを読み込む [詳細]

#include <sent/stddefs.h>
#include <sent/ngram2.h>

ソースコードを見る。

関数

static int get_total_info (FILE *fp, NNID **numlist)
 Set number of N-gram entries, for reading the first LR 2-gram.
static boolean set_unigram (FILE *fp, NGRAM_INFO *ndata)
 Read word/class entry names and 1-gram data from LR 2-gram file.
static boolean add_unigram (FILE *fp, NGRAM_INFO *ndata)
 Read 1-gram data from RL 3-gram file.
static boolean add_bigram (FILE *fp, NGRAM_INFO *ndata)
 Read forward 2-gram data and set the LR 2-gram probabilities to the already loaded RL N-gram.
static boolean set_ngram (FILE *fp, NGRAM_INFO *ndata, int n)
 Read n-gram data for a given N from ARPA n-gram file.
boolean ngram_read_arpa (FILE *fp, NGRAM_INFO *ndata, boolean addition)
 Read in one ARPA N-gram file.

変数

static char buf [800]
 Local buffer for reading.
static char pbuf [800]
 Local buffer for error string.

説明

ARPA形式のN-gramファイルを読み込む

ARPA形式のN-gramファイルを用いる場合,2-gram と逆向き 3-gram を それぞれ別々のファイルから読み込みます.

参照:
ngram2.h
作者:
Akinobu LEE
日付:
Wed Feb 16 16:52:24 2005
Revision:
1.18

ngram_read_arpa.c で定義されています。


関数

static int get_total_info ( FILE *  fp,
NNID **  numlist 
) [static]

Set number of N-gram entries, for reading the first LR 2-gram.

引数:
fp[in] file pointer
numlist[out] set the values to this buffer (malloc)
戻り値:
the value of N, or -1 on error.

ngram_read_arpa.c53 行で定義されています。

参照元 ngram_read_arpa().

static boolean set_unigram ( FILE *  fp,
NGRAM_INFO ndata 
) [static]

Read word/class entry names and 1-gram data from LR 2-gram file.

引数:
fp[in] file pointer
ndata[out] N-gram to set the read data.

ngram_read_arpa.c103 行で定義されています。

参照元 ngram_read_arpa().

static boolean add_unigram ( FILE *  fp,
NGRAM_INFO ndata 
) [static]

Read 1-gram data from RL 3-gram file.

Only the back-off weights are stored.

引数:
fp[in] file pointer
ndata[out] N-gram to store the read data.

ngram_read_arpa.c200 行で定義されています。

参照元 ngram_read_arpa().

static boolean add_bigram ( FILE *  fp,
NGRAM_INFO ndata 
) [static]

Read forward 2-gram data and set the LR 2-gram probabilities to the already loaded RL N-gram.

引数:
fp[in] file pointer
ndata[i/o] N-gram to set the read data.

ngram_read_arpa.c264 行で定義されています。

参照元 ngram_read_arpa().

static boolean set_ngram ( FILE *  fp,
NGRAM_INFO ndata,
int  n 
) [static]

Read n-gram data for a given N from ARPA n-gram file.

(n >= 2)

引数:
fp[in] file pointer
ndata[out] N-gram to set the read data.

ngram_read_arpa.c333 行で定義されています。

参照元 ngram_read_arpa().

boolean ngram_read_arpa ( FILE *  fp,
NGRAM_INFO ndata,
boolean  addition 
)

Read in one ARPA N-gram file.

Supported combinations are LR 2-gram, RL 3-gram and LR 3-gram.

引数:
fp[in] file pointer
ndata[out] N-gram data to store the read data
addition[in] TRUE if going to read additional 2-gram
戻り値:
TRUE on success, FALSE on failure.

ngram_read_arpa.c538 行で定義されています。

参照元 init_ngram_arpa(), と init_ngram_arpa_additional().