static DefaultSimilarity() { for (int i = 0; i < 256; i++) { NORM_TABLE[i] = SmallSingle.SByte315ToSingle((sbyte)i); } }
static BM25Similarity() { for (int i = 0; i < 256; i++) { float f = SmallSingle.SByte315ToSingle((sbyte)i); NORM_TABLE[i] = 1.0f / (f * f); } }
private static float[] LoadNormTable() // LUCENENET: Avoid static constructors (see https://github.com/apache/lucenenet/pull/224#issuecomment-469284006) { float[] normTable = new float[256]; for (int i = 0; i < 256; i++) { normTable[i] = SmallSingle.SByte315ToSingle((sbyte)i); } return(normTable); }