<commit_before>﻿using System;

namespace DotKEGG {

    public sealed class ECNumber {

        public enum Class {
            OxidoReductase = 1,
            Transferase = 2,
            Hydrolase = 3,
            Lyase = 4,
            Isomerase = 5,
            Ligase = 6,
        }

        public ECNumber(Class ecClass, uint id2, uint id3, uint serialId) {
            EcClass = ecClass;
            Id2 = id2;
            Id3 = id3;
            SerialId = serialId;
        }

        public Class EcClass { get; }
        public uint Id2 { get; }
        public uint Id3 { get; }
        public uint SerialId { get; }

        public static ECNumber OxidoReductase(uint id2, uint id3, uint serialId) {
            return new ECNumber(Class.OxidoReductase, id2, id3, serialId);
        }
        public static ECNumber Transferase(uint id2, uint id3, uint serialId) {
            return new ECNumber(Class.Transferase, id2, id3, serialId);
        }
        public static ECNumber Hydrolase(uint id2, uint id3, uint serialId) {
            return new ECNumber(Class.Hydrolase, id2, id3, serialId);
        }
        public static ECNumber Lyase(uint id2, uint id3, uint serialId) {
            return new ECNumber(Class.Lyase, id2, id3, serialId);
        }
        public static ECNumber Isomerase(uint id2, uint id3, uint serialId) {
            return new ECNumber(Class.Isomerase, id2, id3, serialId);
        }
        public static ECNumber Ligase(uint id2, uint id3, uint serialId) {
            return new ECNumber(Class.Ligase, id2, id3, serialId);
        }

        public override bool Equals(object obj) {
            ECNumber ec = obj as ECNumber;
            if (ec == null)
                return false;
            return (
                ec.EcClass == EcClass &&
                ec.Id2 == Id2 &&
                ec.Id3 == Id3 &&
                ec.SerialId == SerialId
            );
        }
        public bool Equals(ECNumber other) {
            if (ReferenceEquals(other, null))
                return false;
            return (
                other.EcClass == EcClass &&
                other.Id2 == Id2 &&
                other.Id3 == Id3 &&
                other.SerialId == SerialId
            );
        }
        public static bool operator ==(ECNumber left, ECNumber right) {
            if (ReferenceEquals(left, null))
                return ReferenceEquals(right, null);
            return left.Equals(right);
        }
        public static bool operator !=(ECNumber left, ECNumber right) {
            if (ReferenceEquals(left, null))
                return !ReferenceEquals(right, null);
            return !left.Equals(right);
        }

        public override int GetHashCode() {
            int hash = 17;

            unchecked {
                hash = hash * 23 + EcClass.GetHashCode();
                hash = hash * 23 + Id2.GetHashCode();
                hash = hash * 23 + Id3.GetHashCode();
                hash = hash * 23 + SerialId.GetHashCode();
            }

            return hash;
        }
        public override string ToString() {
            return $"{(int)EcClass}.{Id2}.{Id3}.{SerialId}";
        }
<commit_msg>ECNumber class now uses expression-bodied methods and 'var'<commit_after>﻿namespace DotKEGG {

    public sealed class ECNumber {

        public enum Class {
            OxidoReductase = 1,
            Transferase = 2,
            Hydrolase = 3,
            Lyase = 4,
            Isomerase = 5,
            Ligase = 6,
        }

        public ECNumber(Class ecClass, uint id2, uint id3, uint serialId) {
            EcClass = ecClass;
            Id2 = id2;
            Id3 = id3;
            SerialId = serialId;
        }

        public Class EcClass { get; }
        public uint Id2 { get; }
        public uint Id3 { get; }
        public uint SerialId { get; }

        public static ECNumber OxidoReductase(uint id2, uint id3, uint serialId) =>
            new ECNumber(Class.OxidoReductase, id2, id3, serialId);
        public static ECNumber Transferase(uint id2, uint id3, uint serialId) =>
            new ECNumber(Class.Transferase, id2, id3, serialId);
        public static ECNumber Hydrolase(uint id2, uint id3, uint serialId) =>
            new ECNumber(Class.Hydrolase, id2, id3, serialId);
        public static ECNumber Lyase(uint id2, uint id3, uint serialId) =>
            new ECNumber(Class.Lyase, id2, id3, serialId);
        public static ECNumber Isomerase(uint id2, uint id3, uint serialId) =>
            new ECNumber(Class.Isomerase, id2, id3, serialId);
        public static ECNumber Ligase(uint id2, uint id3, uint serialId) =>
            new ECNumber(Class.Ligase, id2, id3, serialId);

        public override bool Equals(object obj) {
            var ec = obj as ECNumber;
            if (ec == null)
                return false;
            return (
                ec.EcClass == EcClass &&
                ec.Id2 == Id2 &&
                ec.Id3 == Id3 &&
                ec.SerialId == SerialId
            );
        }
        public bool Equals(ECNumber other) {
            if (ReferenceEquals(other, null))
                return false;
            return (
                other.EcClass == EcClass &&
                other.Id2 == Id2 &&
                other.Id3 == Id3 &&
                other.SerialId == SerialId
            );
        }
        public static bool operator ==(ECNumber left, ECNumber right) {
            if (ReferenceEquals(left, null))
                return ReferenceEquals(right, null);
            return left.Equals(right);
        }
        public static bool operator !=(ECNumber left, ECNumber right) {
            if (ReferenceEquals(left, null))
                return !ReferenceEquals(right, null);
            return !left.Equals(right);
        }

        public override int GetHashCode() {
            int hash = 17;

            unchecked {
                hash = hash * 23 + EcClass.GetHashCode();
                hash = hash * 23 + Id2.GetHashCode();
                hash = hash * 23 + Id3.GetHashCode();
                hash = hash * 23 + SerialId.GetHashCode();
            }

            return hash;
        }
        public override string ToString() => $"{(int)EcClass}.{Id2}.{Id3}.{SerialId}";

{'fraction_non_alphanumeric': 0.09241555130656469, 'fraction_numerical': 0.019120458891013385, 'mean_word_length': 1.5516260162601625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '2846530', 'n_tokens_mistral': 1807, 'n_tokens_neox': 1703, 'n_words': 502}