diff options
author | 2012-04-23 18:08:58 -0700 | |
---|---|---|
committer | 2012-04-23 18:08:58 -0700 | |
commit | 554b85845c205a0fe288bc63368e64ec1357113d (patch) | |
tree | 4a08a9b8821878785436aaa75fe90a4fb88d90f7 /native/jni/src/binary_format.h | |
parent | fa1affbaecf4b851169294203654556cdc31ea38 (diff) | |
parent | 171d1809ffc724de4fb793f481d592644e3d141e (diff) | |
download | latinime-554b85845c205a0fe288bc63368e64ec1357113d.tar.gz latinime-554b85845c205a0fe288bc63368e64ec1357113d.tar.xz latinime-554b85845c205a0fe288bc63368e64ec1357113d.zip |
Merge "Add methods to inverse compute the probability."
Diffstat (limited to 'native/jni/src/binary_format.h')
-rw-r--r-- | native/jni/src/binary_format.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/native/jni/src/binary_format.h b/native/jni/src/binary_format.h index b8ac95250..d5d67c108 100644 --- a/native/jni/src/binary_format.h +++ b/native/jni/src/binary_format.h @@ -66,6 +66,7 @@ class BinaryFormat { const int length); static int getWordAtAddress(const uint8_t* const root, const int address, const int maxDepth, uint16_t* outWord); + static int getProbability(const int bigramListPosition, const int unigramFreq); // Flags for special processing // Those *must* match the flags in makedict (BinaryDictInputOutput#*_PROCESSING_FLAG) or @@ -517,6 +518,14 @@ inline int BinaryFormat::getWordAtAddress(const uint8_t* const root, const int a return 0; } +// This should probably return a probability in log space. +inline int BinaryFormat::getProbability(const int bigramListPosition, const int unigramFreq) { + // TODO: use the bigram list position to get the bigram probability. If the bigram + // is not found, use the unigram frequency. + // TODO: if the unigram frequency is used, compute the actual probability + return unigramFreq; +} + } // namespace latinime #endif // LATINIME_BINARY_FORMAT_H |