public void fillTable() { tb.Rows.Clear(); int[,] huff = HuffText.getHuffText(); for (int i = 0; i < huff.Length / 3; i++) { if (huff[i, 0] == 0 && huff[i, 1] == 0 && huff[i, 2] != 0) { string en = HuffText.replaceChar((char)huff[i, 2]); string comment = ""; string ru = Config.get().getCharInfo(en, ref comment); tb.Rows.Add(new object[] { en, ru, comment }); } } }
private string makeRuString(string s) { string res = ""; string cs = ""; string cmt = ""; while ((cs = HuffText.replaceChar(HuffText.nextChar(ref s))) != string.Empty) { string st = Config.get().getCharInfo(cs, ref cmt); if (st == string.Empty) { res += cs; } else { res += st; } } return(res); }
private string getChar(ref int ofs, ref int bit) { int pos = 0; while (true) { if (getBit(ref ofs, ref bit)) { pos = hftbl[pos, 1]; } else { pos = hftbl[pos, 0]; } if (hftbl[pos, 0] == 0 && hftbl[pos, 1] == 0) { return(HuffText.replaceChar((char)hftbl[pos, 2])); } } }