trigram cache that enhance locating trigram for a given bigram (w_1,w_2) More...
#include <lm.h>
trigram cache that enhance locating trigram for a given bigram (w_1,w_2)
The following trigram information cache eliminates most traversals of 1g->2g->3g tree to locate trigrams for a given bigram (w1,w2). The organization is optimized for locality of access. All bigrams (*,w2) for a given w2, for which trigrams have been accessed "recently", form a linear linked list, pointed to by lm_t.tginfo[w2]. If disk-based, all trigrams for the given bg loaded upon request. Cached info (and tg if disk-based) freed at lm_reset if not used since last such reset.