Ejemplo n.º 1
0
        public FrequencyVector<string> ParseFrequency(string file)
        {
            FrequencyVector<string> frequences = new FrequencyVector<string>();

            Encoding encoding = EncodingDetector.DetectEncoding(file);
            using (StreamReader reader = new StreamReader(file, encoding))
            {
                string line;

                while ((line = reader.ReadLine()) != null)
                {
                    string[] parts = line.Split(separator, StringSplitOptions.RemoveEmptyEntries);
                    frequences.Add(parts[0].ToString(), int.Parse(parts[1]));
                }
            }

            return frequences;
        }
Ejemplo n.º 2
0
 internal void AddFrequencyVector(FrequencyVectorType type, FrequencyVector<string> vector)
 {
     frequences.Add(type, vector);
 }