Loading native/jni/src/suggest/policyimpl/dictionary/structure/v4/content/bigram_dict_content.h +4 −4 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ #ifndef LATINIME_BIGRAM_DICT_CONTENT_H #define LATINIME_BIGRAM_DICT_CONTENT_H #include <cstdint> #include <cstdio> #include "defines.h" Loading @@ -28,11 +27,12 @@ namespace latinime { class ReadWriteByteArrayView; class BigramDictContent : public SparseTableDictContent { public: BigramDictContent(uint8_t *const *buffers, const int *bufferSizes, const bool hasHistoricalInfo) : SparseTableDictContent(buffers, bufferSizes, Ver4DictConstants::BIGRAM_ADDRESS_TABLE_BLOCK_SIZE, BigramDictContent(const ReadWriteByteArrayView *const buffers, const bool hasHistoricalInfo) : SparseTableDictContent(buffers, Ver4DictConstants::BIGRAM_ADDRESS_TABLE_BLOCK_SIZE, Ver4DictConstants::BIGRAM_ADDRESS_TABLE_DATA_SIZE), mHasHistoricalInfo(hasHistoricalInfo) {} Loading native/jni/src/suggest/policyimpl/dictionary/structure/v4/content/shortcut_dict_content.h +4 −4 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ #ifndef LATINIME_SHORTCUT_DICT_CONTENT_H #define LATINIME_SHORTCUT_DICT_CONTENT_H #include <cstdint> #include <cstdio> #include "defines.h" Loading @@ -27,11 +26,12 @@ namespace latinime { class ReadWriteByteArrayView; class ShortcutDictContent : public SparseTableDictContent { public: ShortcutDictContent(uint8_t *const *buffers, const int *bufferSizes) : SparseTableDictContent(buffers, bufferSizes, Ver4DictConstants::SHORTCUT_ADDRESS_TABLE_BLOCK_SIZE, ShortcutDictContent(const ReadWriteByteArrayView *const buffers) : SparseTableDictContent(buffers, Ver4DictConstants::SHORTCUT_ADDRESS_TABLE_BLOCK_SIZE, Ver4DictConstants::SHORTCUT_ADDRESS_TABLE_DATA_SIZE) {} ShortcutDictContent() Loading native/jni/src/suggest/policyimpl/dictionary/structure/v4/content/single_dict_content.h +3 −4 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ #ifndef LATINIME_SINGLE_DICT_CONTENT_H #define LATINIME_SINGLE_DICT_CONTENT_H #include <cstdint> #include <cstdio> #include "defines.h" Loading @@ -30,8 +29,8 @@ namespace latinime { class SingleDictContent { public: SingleDictContent(uint8_t *const buffer, const int bufferSize) : mExpandableContentBuffer(ReadWriteByteArrayView(buffer, bufferSize), SingleDictContent(const ReadWriteByteArrayView buffer) : mExpandableContentBuffer(buffer, BufferWithExtendableBuffer::DEFAULT_MAX_ADDITIONAL_BUFFER_SIZE) {} SingleDictContent() Loading native/jni/src/suggest/policyimpl/dictionary/structure/v4/content/sparse_table_dict_content.h +4 −11 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ #ifndef LATINIME_SPARSE_TABLE_DICT_CONTENT_H #define LATINIME_SPARSE_TABLE_DICT_CONTENT_H #include <cstdint> #include <cstdio> #include "defines.h" Loading @@ -31,19 +30,13 @@ namespace latinime { // TODO: Support multiple contents. class SparseTableDictContent { public: AK_FORCE_INLINE SparseTableDictContent(uint8_t *const *buffers, const int *bufferSizes, AK_FORCE_INLINE SparseTableDictContent(const ReadWriteByteArrayView *const buffers, const int sparseTableBlockSize, const int sparseTableDataSize) : mExpandableLookupTableBuffer( ReadWriteByteArrayView(buffers[LOOKUP_TABLE_BUFFER_INDEX], bufferSizes[LOOKUP_TABLE_BUFFER_INDEX]), : mExpandableLookupTableBuffer(buffers[LOOKUP_TABLE_BUFFER_INDEX], BufferWithExtendableBuffer::DEFAULT_MAX_ADDITIONAL_BUFFER_SIZE), mExpandableAddressTableBuffer( ReadWriteByteArrayView(buffers[ADDRESS_TABLE_BUFFER_INDEX], bufferSizes[ADDRESS_TABLE_BUFFER_INDEX]), mExpandableAddressTableBuffer(buffers[ADDRESS_TABLE_BUFFER_INDEX], BufferWithExtendableBuffer::DEFAULT_MAX_ADDITIONAL_BUFFER_SIZE), mExpandableContentBuffer( ReadWriteByteArrayView(buffers[CONTENT_BUFFER_INDEX], bufferSizes[CONTENT_BUFFER_INDEX]), mExpandableContentBuffer(buffers[CONTENT_BUFFER_INDEX], BufferWithExtendableBuffer::DEFAULT_MAX_ADDITIONAL_BUFFER_SIZE), mAddressLookupTable(&mExpandableLookupTableBuffer, &mExpandableAddressTableBuffer, sparseTableBlockSize, sparseTableDataSize) {} Loading native/jni/src/suggest/policyimpl/dictionary/structure/v4/content/terminal_position_lookup_table.h +3 −3 Original line number Diff line number Diff line Loading @@ -17,13 +17,13 @@ #ifndef LATINIME_TERMINAL_POSITION_LOOKUP_TABLE_H #define LATINIME_TERMINAL_POSITION_LOOKUP_TABLE_H #include <cstdint> #include <cstdio> #include <unordered_map> #include "defines.h" #include "suggest/policyimpl/dictionary/structure/v4/content/single_dict_content.h" #include "suggest/policyimpl/dictionary/structure/v4/ver4_dict_constants.h" #include "utils/byte_array_view.h" namespace latinime { Loading @@ -31,8 +31,8 @@ class TerminalPositionLookupTable : public SingleDictContent { public: typedef std::unordered_map<int, int> TerminalIdMap; TerminalPositionLookupTable(uint8_t *const buffer, const int bufferSize) : SingleDictContent(buffer, bufferSize), TerminalPositionLookupTable(const ReadWriteByteArrayView buffer) : SingleDictContent(buffer), mSize(getBuffer()->getTailPosition() / Ver4DictConstants::TERMINAL_ADDRESS_TABLE_ADDRESS_SIZE) {} Loading Loading
native/jni/src/suggest/policyimpl/dictionary/structure/v4/content/bigram_dict_content.h +4 −4 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ #ifndef LATINIME_BIGRAM_DICT_CONTENT_H #define LATINIME_BIGRAM_DICT_CONTENT_H #include <cstdint> #include <cstdio> #include "defines.h" Loading @@ -28,11 +27,12 @@ namespace latinime { class ReadWriteByteArrayView; class BigramDictContent : public SparseTableDictContent { public: BigramDictContent(uint8_t *const *buffers, const int *bufferSizes, const bool hasHistoricalInfo) : SparseTableDictContent(buffers, bufferSizes, Ver4DictConstants::BIGRAM_ADDRESS_TABLE_BLOCK_SIZE, BigramDictContent(const ReadWriteByteArrayView *const buffers, const bool hasHistoricalInfo) : SparseTableDictContent(buffers, Ver4DictConstants::BIGRAM_ADDRESS_TABLE_BLOCK_SIZE, Ver4DictConstants::BIGRAM_ADDRESS_TABLE_DATA_SIZE), mHasHistoricalInfo(hasHistoricalInfo) {} Loading
native/jni/src/suggest/policyimpl/dictionary/structure/v4/content/shortcut_dict_content.h +4 −4 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ #ifndef LATINIME_SHORTCUT_DICT_CONTENT_H #define LATINIME_SHORTCUT_DICT_CONTENT_H #include <cstdint> #include <cstdio> #include "defines.h" Loading @@ -27,11 +26,12 @@ namespace latinime { class ReadWriteByteArrayView; class ShortcutDictContent : public SparseTableDictContent { public: ShortcutDictContent(uint8_t *const *buffers, const int *bufferSizes) : SparseTableDictContent(buffers, bufferSizes, Ver4DictConstants::SHORTCUT_ADDRESS_TABLE_BLOCK_SIZE, ShortcutDictContent(const ReadWriteByteArrayView *const buffers) : SparseTableDictContent(buffers, Ver4DictConstants::SHORTCUT_ADDRESS_TABLE_BLOCK_SIZE, Ver4DictConstants::SHORTCUT_ADDRESS_TABLE_DATA_SIZE) {} ShortcutDictContent() Loading
native/jni/src/suggest/policyimpl/dictionary/structure/v4/content/single_dict_content.h +3 −4 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ #ifndef LATINIME_SINGLE_DICT_CONTENT_H #define LATINIME_SINGLE_DICT_CONTENT_H #include <cstdint> #include <cstdio> #include "defines.h" Loading @@ -30,8 +29,8 @@ namespace latinime { class SingleDictContent { public: SingleDictContent(uint8_t *const buffer, const int bufferSize) : mExpandableContentBuffer(ReadWriteByteArrayView(buffer, bufferSize), SingleDictContent(const ReadWriteByteArrayView buffer) : mExpandableContentBuffer(buffer, BufferWithExtendableBuffer::DEFAULT_MAX_ADDITIONAL_BUFFER_SIZE) {} SingleDictContent() Loading
native/jni/src/suggest/policyimpl/dictionary/structure/v4/content/sparse_table_dict_content.h +4 −11 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ #ifndef LATINIME_SPARSE_TABLE_DICT_CONTENT_H #define LATINIME_SPARSE_TABLE_DICT_CONTENT_H #include <cstdint> #include <cstdio> #include "defines.h" Loading @@ -31,19 +30,13 @@ namespace latinime { // TODO: Support multiple contents. class SparseTableDictContent { public: AK_FORCE_INLINE SparseTableDictContent(uint8_t *const *buffers, const int *bufferSizes, AK_FORCE_INLINE SparseTableDictContent(const ReadWriteByteArrayView *const buffers, const int sparseTableBlockSize, const int sparseTableDataSize) : mExpandableLookupTableBuffer( ReadWriteByteArrayView(buffers[LOOKUP_TABLE_BUFFER_INDEX], bufferSizes[LOOKUP_TABLE_BUFFER_INDEX]), : mExpandableLookupTableBuffer(buffers[LOOKUP_TABLE_BUFFER_INDEX], BufferWithExtendableBuffer::DEFAULT_MAX_ADDITIONAL_BUFFER_SIZE), mExpandableAddressTableBuffer( ReadWriteByteArrayView(buffers[ADDRESS_TABLE_BUFFER_INDEX], bufferSizes[ADDRESS_TABLE_BUFFER_INDEX]), mExpandableAddressTableBuffer(buffers[ADDRESS_TABLE_BUFFER_INDEX], BufferWithExtendableBuffer::DEFAULT_MAX_ADDITIONAL_BUFFER_SIZE), mExpandableContentBuffer( ReadWriteByteArrayView(buffers[CONTENT_BUFFER_INDEX], bufferSizes[CONTENT_BUFFER_INDEX]), mExpandableContentBuffer(buffers[CONTENT_BUFFER_INDEX], BufferWithExtendableBuffer::DEFAULT_MAX_ADDITIONAL_BUFFER_SIZE), mAddressLookupTable(&mExpandableLookupTableBuffer, &mExpandableAddressTableBuffer, sparseTableBlockSize, sparseTableDataSize) {} Loading
native/jni/src/suggest/policyimpl/dictionary/structure/v4/content/terminal_position_lookup_table.h +3 −3 Original line number Diff line number Diff line Loading @@ -17,13 +17,13 @@ #ifndef LATINIME_TERMINAL_POSITION_LOOKUP_TABLE_H #define LATINIME_TERMINAL_POSITION_LOOKUP_TABLE_H #include <cstdint> #include <cstdio> #include <unordered_map> #include "defines.h" #include "suggest/policyimpl/dictionary/structure/v4/content/single_dict_content.h" #include "suggest/policyimpl/dictionary/structure/v4/ver4_dict_constants.h" #include "utils/byte_array_view.h" namespace latinime { Loading @@ -31,8 +31,8 @@ class TerminalPositionLookupTable : public SingleDictContent { public: typedef std::unordered_map<int, int> TerminalIdMap; TerminalPositionLookupTable(uint8_t *const buffer, const int bufferSize) : SingleDictContent(buffer, bufferSize), TerminalPositionLookupTable(const ReadWriteByteArrayView buffer) : SingleDictContent(buffer), mSize(getBuffer()->getTailPosition() / Ver4DictConstants::TERMINAL_ADDRESS_TABLE_ADDRESS_SIZE) {} Loading