public string decodeBitsAdvanced(string bits) { if (string.IsNullOrEmpty(bits)) { return(""); } DTMCFRChunker chunker = new DTMCFRChunker(); List <DTMCFRDataChunk> chunks = chunker.ChunkBits(bits); if (!chunks.Any()) { return(""); } if (chunks.Count == 1) { return("."); } DTMCFRDataToAnalysis[] arr = chunker.GetArrayToAnalysis(chunks); DTMCFRClustering2 clustering = new DTMCFRClustering2(); double[] means = new double[3] { 1.0, 3.0, 7.0 }; //initial means clustering.Cluster(arr, means); //Console.WriteLine($"means: {means[0]} | {means[1]} | {means[2]}"); DTMCFRDecoder decoder = new DTMCFRDecoder(); return(decoder.TryDecodeAndMoveOneLeft(chunks, arr)); }
public string decodeMorse(string morseCode) { // Map morse code using map Preloaded.MORSE_CODE if (string.IsNullOrEmpty(morseCode) || string.IsNullOrWhiteSpace(morseCode)) { return(""); } DTMCFRDecoder decoder = new DTMCFRDecoder(); string res; decoder.TryDecodeMorse(morseCode, out res); return(res); }