Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

ngram_access.c File Reference

Get N-gram probability of a word/class sequence. More...

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

Include dependency graph for ngram_access.c:

Go to the source code of this file.

Functions

NNID search_bigram (NGRAM_INFO *ndata, WORD_ID w_l, WORD_ID w_r)
static NNID search_trigram_v3 (NGRAM_INFO *ndata, NNID n2, WORD_ID wkey)
static NNID search_trigram_v4 (NGRAM_INFO *ndata, NNID n2, WORD_ID wkey)
LOGPROB uni_prob (NGRAM_INFO *ndata, WORD_ID w)
LOGPROB bi_prob_lr (NGRAM_INFO *ndata, WORD_ID w1, WORD_ID w2)
LOGPROB bi_prob_rl (NGRAM_INFO *ndata, WORD_ID w1, WORD_ID w2)
LOGPROB tri_prob_rl (NGRAM_INFO *ndata, WORD_ID w1, WORD_ID w2, WORD_ID w3)


Detailed Description

Get N-gram probability of a word/class sequence.

Author:
Akinobu LEE
Date:
Wed Feb 16 07:46:18 2005
Revision
1.2

Definition in file ngram_access.c.


Function Documentation

NNID search_bigram NGRAM_INFO ndata,
WORD_ID  w_l,
WORD_ID  w_r
 

Search for 2-gram tuple (w_l, w_r) in the 2-gram part of N-gram.

Parameters:
ndata [in] word/class N-gram
w_l [in] left word/class ID in N-gram
w_r [in] right word/class ID in N-gram
Returns:
corresponding index to the 2-gram data part if found, or NNID_INVALID if the tuple does not exist in 2-gram.

Definition at line 39 of file ngram_access.c.

Referenced by add_bigram_rl(), bi_prob_lr(), bi_prob_rl(), set_trigram(), and tri_prob_rl().

static NNID search_trigram_v3 NGRAM_INFO ndata,
NNID  n2,
WORD_ID  wkey
[static]
 

Search for a reverse 3-gram tuple (wkey, w1, w2), where the context 2-gram tuple (w1, w2) should exist on 2-gram data part at n2.

(for v3 struture format)

Parameters:
ndata [in] word/class N-gram
n2 [in] 2-gram data part where context 2-gram data exists.
wkey [in] left word/class ID in N-gram
Returns:
corresponding index to the 3-gram data part if found, or NNID_INVALID if the 3-gram does not exist.

Definition at line 77 of file ngram_access.c.

Referenced by tri_prob_rl().

static NNID search_trigram_v4 NGRAM_INFO ndata,
NNID  n2,
WORD_ID  wkey
[static]
 

Search for a reverse 3-gram tuple (wkey, w1, w2), where the context 2-gram tuple (w1, w2) should exist on 2-gram data part at n2.

(for v4 struture format)

Parameters:
ndata [in] word/class N-gram
n2 [in] 2-gram data part where context 2-gram data exists.
wkey [in] left word/class ID in N-gram
Returns:
corresponding index to the 3-gram data part if found, or NNID_INVALID if the 3-gram does not exist.

Definition at line 115 of file ngram_access.c.

Referenced by tri_prob_rl().

LOGPROB uni_prob NGRAM_INFO ndata,
WORD_ID  w
 

Get 1-gram probability of $w$ in log10.

Parameters:
ndata [in] word/class N-gram
w [in] word/class ID in N-gram
Returns:
log10 probability $\log p(w)$ .

Definition at line 154 of file ngram_access.c.

Referenced by build_wchmm(), and build_wchmm2().

LOGPROB bi_prob_lr NGRAM_INFO ndata,
WORD_ID  w1,
WORD_ID  w2
 

Get LR 2-gram probability of word/class sequence $(w_1, w_2)$ in log10

Parameters:
ndata [in] word/class N-gram
w1 [in] left word/class ID in N-gram
w2 [in] right word/class ID in N-gram (to compute probability)
Returns:
log10 probability $\log p(w_2|w_1)$ .

Definition at line 175 of file ngram_access.c.

LOGPROB bi_prob_rl NGRAM_INFO ndata,
WORD_ID  w1,
WORD_ID  w2
 

Get RL 2-gram probability of word/class sequence $(w_1, w_2)$ in log10.

Parameters:
ndata [in] word/class N-gram
w1 [in] left word/class ID in N-gram (to compute probability)
w2 [in] right word/class ID in N-gram
Returns:
log10 probability $\log p(w_1|w_2)$ .

Definition at line 206 of file ngram_access.c.

Referenced by tri_prob_rl().

LOGPROB tri_prob_rl NGRAM_INFO ndata,
WORD_ID  w1,
WORD_ID  w2,
WORD_ID  w3
 

Get RL 3-gram probability of word/class sequence $(w_1, w_2, w_3)$ in log10.

Parameters:
ndata [in] word/class N-gram
w1 [in] left word/class ID in N-gram (to compute probability)
w2 [in] middle word/class ID in N-gram
w3 [in] right word/class ID in N-gram
Returns:
log10 probability $\log p(w_1|w_2, w_3)$ .

Definition at line 239 of file ngram_access.c.


Generated on Tue Mar 28 16:19:22 2006 for Julius by  doxygen 1.4.2