Lines Matching refs:pos
36 static int getGroupCountAndForwardPointer(const uint8_t* const dict, int* pos);
37 static uint8_t getFlagsAndForwardPointer(const uint8_t* const dict, int* pos);
38 static int32_t getCharCodeAndForwardPointer(const uint8_t* const dict, int* pos);
39 static int readFrequencyWithoutMovingPointer(const uint8_t* const dict, const int pos);
40 static int skipOtherCharacters(const uint8_t* const dict, const int pos);
41 static int skipAttributes(const uint8_t* const dict, const int pos);
42 static int skipChildrenPosition(const uint8_t flags, const int pos);
43 static int skipFrequency(const uint8_t flags, const int pos);
44 static int skipAllAttributes(const uint8_t* const dict, const uint8_t flags, const int pos);
46 const int pos);
47 static int readChildrenPosition(const uint8_t* const dict, const uint8_t flags, const int pos);
50 int *pos);
63 inline int BinaryFormat::getGroupCountAndForwardPointer(const uint8_t* const dict, int* pos) {
64 return dict[(*pos)++];
67 inline uint8_t BinaryFormat::getFlagsAndForwardPointer(const uint8_t* const dict, int* pos) {
68 return dict[(*pos)++];
71 inline int32_t BinaryFormat::getCharCodeAndForwardPointer(const uint8_t* const dict, int* pos) {
72 const int origin = *pos;
76 *pos = origin + 1;
79 *pos = origin + 3;
85 *pos = origin + 1;
91 const int pos) {
92 return dict[pos];
95 inline int BinaryFormat::skipOtherCharacters(const uint8_t* const dict, const int pos) {
96 int currentPos = pos;
121 inline int BinaryFormat::skipAttributes(const uint8_t* const dict, const int pos) {
122 int currentPos = pos;
138 inline int BinaryFormat::skipChildrenPosition(const uint8_t flags, const int pos) {
139 return pos + childrenAddressSize(flags);
142 inline int BinaryFormat::skipFrequency(const uint8_t flags, const int pos) {
143 return UnigramDictionary::FLAG_IS_TERMINAL & flags ? pos + 1 : pos;
147 const int pos) {
153 return skipAttributes(dict, pos);
155 return pos;
160 const uint8_t flags, const int pos) {
161 int currentPos = pos;
168 const int pos) {
172 offset = dict[pos];
175 offset = dict[pos] << 8;
176 offset += dict[pos + 1];
179 offset = dict[pos] << 16;
180 offset += dict[pos + 1] << 8;
181 offset += dict[pos + 2];
188 return pos + offset;
197 const uint8_t flags, int *pos) {
199 const int origin = *pos;
203 *pos = origin + 1;
208 *pos = origin + 2;
214 *pos = origin + 3;
228 int pos = 0;
235 int charGroupCount = BinaryFormat::getGroupCountAndForwardPointer(root, &pos);
241 const int charGroupPos = pos;
242 const uint8_t flags = BinaryFormat::getFlagsAndForwardPointer(root, &pos);
243 int32_t character = BinaryFormat::getCharCodeAndForwardPointer(root, &pos);
250 character = BinaryFormat::getCharCodeAndForwardPointer(root, &pos);
259 character = BinaryFormat::getCharCodeAndForwardPointer(root, &pos);
271 pos = BinaryFormat::skipFrequency(UnigramDictionary::FLAG_IS_TERMINAL, pos);
280 pos = BinaryFormat::readChildrenPosition(root, flags, pos);
285 pos = BinaryFormat::skipOtherCharacters(root, pos);
287 pos = BinaryFormat::skipFrequency(flags, pos);
288 pos = BinaryFormat::skipChildrenPosAndAttributes(root, flags, pos);
314 int pos = 0;
327 for (int charGroupCount = getGroupCountAndForwardPointer(root, &pos); charGroupCount > 0;
329 const int startPos = pos;
330 const uint8_t flags = getFlagsAndForwardPointer(root, &pos);
331 const int32_t character = getCharCodeAndForwardPointer(root, &pos);
337 int32_t nextChar = getCharCodeAndForwardPointer(root, &pos);
343 nextChar = getCharCodeAndForwardPointer(root, &pos);
351 pos = skipOtherCharacters(root, pos);
353 pos = skipFrequency(flags, pos);
367 const int childrenPos = readChildrenPosition(root, flags, pos);
369 // If the children pos is greater than address, it means the previous chargroup,
410 // it's there, read pos, and break to resume the search at pos.
412 pos = readChildrenPosition(root, lastFlags, lastCandidateGroupPos);
422 pos = skipChildrenPosAndAttributes(root, flags, pos);
428 // Now skip the end of this group (children pos and the attributes if any) so that
429 // our pos is after the end of this char group, at the start of the next one.
430 pos = skipChildrenPosAndAttributes(root, flags, pos);