#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) |
Definition in file ngram_access.c.
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.
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 |
Definition at line 39 of file ngram_access.c.
Referenced by add_bigram_rl(), bi_prob_lr(), bi_prob_rl(), 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)
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 |
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)
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 |
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 in log10.
ndata | [in] word/class N-gram | |
w | [in] word/class ID in N-gram |
Definition at line 154 of file ngram_access.c.
LOGPROB bi_prob_lr | ( | NGRAM_INFO * | ndata, | |
WORD_ID | w1, | |||
WORD_ID | w2 | |||
) |
Get LR 2-gram probability of word/class sequence in log10
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) |
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 in log10.
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 |
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 in log10.
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 |
Definition at line 239 of file ngram_access.c.