Lines Matching defs:group

249      * Compute the binary size of the character array in a group
254 * @param group the group
257 private static int getGroupCharactersSize(CharGroup group) {
258 int size = CharEncoding.getCharArraySize(group.mChars);
259 if (group.hasSeveralChars()) size += GROUP_TERMINATOR_SIZE;
266 * @param group the CharGroup to compute the size of.
267 * @return the maximum size of the group.
269 private static int getCharGroupMaximumSize(CharGroup group) {
270 int size = getGroupCharactersSize(group) + GROUP_FLAGS_SIZE;
272 if (group.isTerminal()) size += GROUP_FREQUENCY_SIZE;
274 if (null != group.mBigrams) {
275 for (WeightedString bigram : group.mBigrams) {
352 for (CharGroup group : branches) {
353 if (null != group.mChildren) flattenTreeInner(list, group.mChildren);
382 for (CharGroup group : node.mData) {
383 int groupSize = GROUP_FLAGS_SIZE + getGroupCharactersSize(group);
384 if (group.isTerminal()) groupSize += GROUP_FREQUENCY_SIZE;
385 if (null != group.mChildren) {
387 final int offset = group.mChildren.mCachedAddress - offsetBasePoint;
390 if (null != group.mBigrams) {
391 for (WeightedString bigram : group.mBigrams) {
399 group.mCachedSize = groupSize;
526 private static byte makeCharGroupFlags(final CharGroup group, final int groupAddress,
529 if (group.mChars.length > 1) flags |= FLAG_HAS_MULTIPLE_CHARS;
530 if (group.mFrequency >= 0) {
533 if (null != group.mChildren) {
548 if (null != group.mBigrams) flags |= FLAG_HAS_BIGRAMS;
597 throw new RuntimeException("A node has a group count over 127 (" + size + ").");
602 CharGroup group = node.mData.get(i);
603 if (index != group.mCachedAddress) throw new RuntimeException("Bug: write index is not "
604 + "the same as the cached address of the group");
605 groupAddress += GROUP_FLAGS_SIZE + getGroupCharactersSize(group);
607 if (group.mFrequency > MAX_TERMINAL_FREQUENCY) {
609 + " : " + group.mFrequency);
611 if (group.mFrequency >= 0) groupAddress += GROUP_FREQUENCY_SIZE;
612 final int childrenOffset = null == group.mChildren
613 ? NO_CHILDREN_ADDRESS : group.mChildren.mCachedAddress - groupAddress;
614 byte flags = makeCharGroupFlags(group, groupAddress, childrenOffset);
616 index = CharEncoding.writeCharArray(group.mChars, buffer, index);
617 if (group.hasSeveralChars()) {
620 if (group.mFrequency >= 0) {
621 buffer[index++] = (byte) group.mFrequency;
628 if (null != group.mBigrams) {
629 int remainingBigrams = group.mBigrams.size();
630 for (WeightedString bigram : group.mBigrams) {
867 int groupOffset = 1; // 1 for the group count
925 int groupOffset = nodeOrigin + 1; // 1 byte for the group count