<commit_before>﻿/*
 *      Copyright (c) 2014-2015, SynapLink, LLC
 *      All Rights reserved.
 *      
 *      Released under BSD 3-Clause licence. See terms in
 *      /LICENCE, or online: http://opensource.org/licenses/BSD-3-Clause
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SynapLink.Zener.Archives
{
    /// <summary>
    /// Defines the interface for working with archive files.
    /// </summary>
    public class Archive
    {
        /// <summary>
        /// The number of files in the archive.
        /// </summary>
        public abstract int Count { get; }
        /// <summary>
        /// The names of the files in the archive.
        /// </summary>
        public abstract IEnumerable<string> Files { get; }

        /// <summary>
        /// Retrieves a file from the archive based on its name.
        /// </summary>
        /// <param name="name">The name of the file to retrieve.</param>
        /// <returns>An enumerable containing the file's contents.</returns>
        public abstract IEnumerable<byte> GetFile(string name);
        /// <summary>
        /// Retrieves a file from the archive based on its name, and
        /// returns it after converting it to a string with the specified
        /// encoding.
        /// </summary>
        /// <param name="name">The name of the file to retrieve.</param>
        /// <param name="encoding">The encoding to apply to the file.</param>
        /// <returns>A string containing the encoded contents of the file.</returns>
        public virtual string GetFile(string name, Encoding encoding)
        {
            return encoding.GetString(this.GetFileByName(name).ToArray());
        }
    }
}<commit_msg>* forgot to make class Archive abstract * forgot to change name in method call<commit_after>﻿/*
 *      Copyright (c) 2014-2015, SynapLink, LLC
 *      All Rights reserved.
 *      
 *      Released under BSD 3-Clause licence. See terms in
 *      /LICENCE, or online: http://opensource.org/licenses/BSD-3-Clause
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SynapLink.Zener.Archives
{
    /// <summary>
    /// Defines the interface for working with archive files.
    /// </summary>
    public abstract class Archive
    {
        /// <summary>
        /// The number of files in the archive.
        /// </summary>
        public abstract int Count { get; }
        /// <summary>
        /// The names of the files in the archive.
        /// </summary>
        public abstract IEnumerable<string> Files { get; }

        /// <summary>
        /// Retrieves a file from the archive based on its name.
        /// </summary>
        /// <param name="name">The name of the file to retrieve.</param>
        /// <returns>An enumerable containing the file's contents.</returns>
        public abstract IEnumerable<byte> GetFile(string name);
        /// <summary>
        /// Retrieves a file from the archive based on its name, and
        /// returns it after converting it to a string with the specified
        /// encoding.
        /// </summary>
        /// <param name="name">The name of the file to retrieve.</param>
        /// <param name="encoding">The encoding to apply to the file.</param>
        /// <returns>A string containing the encoded contents of the file.</returns>
        public virtual string GetFile(string name, Encoding encoding)
        {
            return encoding.GetString(this.GetFile(name).ToArray());
        }
    }
}
{'fraction_non_alphanumeric': 0.11917960088691797, 'fraction_numerical': 0.005543237250554324, 'mean_word_length': 2.053299492385787, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4249245', 'n_tokens_mistral': 952, 'n_tokens_neox': 934, 'n_words': 344}