This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.iva.nlp.document; | |
import java.util.Arrays; | |
import java.util.BitSet; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
public class DocumentInvertedIndexer { | |
public static class Node { | |
private final int index; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.iva.nlp.document; | |
import java.util.Arrays; | |
import java.util.BitSet; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
public class DocumentInvertedIndexer { | |
public static class Node { | |
private final int index; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int N = fin.len; | |
const int CH_BITS = 25; | |
FSM fsm; | |
memset(&fsm, 0, sizeof(FSM)); | |
memset(fsm.index, -1, sizeof(fsm.index)); | |
init_fsm(fsm); | |
{ | |
byte* t2 = new byte[1 << 24]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<int scale_bits> void rescale_freq16(uint16(&freq)[0x100]) { | |
const int total_freq = 1 << scale_bits; | |
int total = 0; | |
for (int i = 0; i < 0x100; i++) { | |
total += freq[i]; | |
} | |
uint64 div = (1ULL << 31) / total; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void opt_parse_path_alt(const byte* window, ParsePath* table, const MatchNode* match_table, State& state, int opt_current_p, int opt_start_at, int opt_next_at, int block_end) { | |
const int MAX_STATE_SIZE = 0x100; | |
const int MAX_STATE_MASK = MAX_STATE_SIZE - 1; | |
struct CarriedState { | |
byte match_hist; | |
BitNibble2 cmd[4]; | |
RepState rep; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void test_huf(FileReader *reader) { | |
const int FAST_BITS = 7; | |
const int MAX_BITS = 11; | |
uint32 counts[0x100] = { 0 }; | |
byte buf[1 << 12]; | |
uint32 n = 0; | |
reader->Rewind(); | |
while ((n = reader->Read(buf, sizeof(buf))) > 0) { | |
for (uint32 i = 0; i < n; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code generates a band limited impulse train, then uses the table | |
// to generate an antialiased square wave at two different frequencies. | |
// The computational cost of using BLIT is far less than a sinc resampler | |
// because points are only evaluated on sample changes instead of every | |
// sampled point. | |
const static lc_u32 AUDIO_RATE = 44100; | |
void agb_test_audio_blit() { | |
const int FRAME_AUDIO_SIZE = (AUDIO_RATE + 59) / 60; |