private void btn_Code_Click(object sender, EventArgs e) { rtb_Output.Clear(); _lz78 = new LZ78(); var answer = _lz78.Encode(rtb_Input.Text); for (int i = 0; i < answer.Count; i++) { for (int j = 1; j < answer[i].Length - 1; j++) { rtb_Output.AppendText($"({answer[i][j].Key} , {answer[i][j].Value})\n"); } } GetCompressionDegree(answer); }
static void Main(string[] args) { LZ78 kompress_file = new LZ78(); kompress_file.InsertFileName(); kompress_file.insertMode(); kompress_file.showProgress += lz78_showProgres; if (kompress_file.mode == 1) { kompress_file.Compress(); } else if (kompress_file.mode == 2) { kompress_file.Decompress(); } kompress_file.ReadDataFromFile(); }
public Form1() { InitializeComponent(); _lz78 = new LZ78(); }