<commit_before>using System;
using System.IO;
using System.Text;
using Axiom.Animating;
using Axiom.MathLib;

namespace Axiom.Serialization {
    /// <summary>
    /// 	Summary description for OgreSkeletonReader.
    /// </summary>
    public class OgreSkeletonReader : BinaryReader {
        #region Member variables
		
        const int CHUNK_OVERHEAD_SIZE = 6;
        const string VERSION = "[Serializer_v1.10]";

        private Skeleton skeleton;
        private int currentChunkLength;

        #endregion
		
        #region Constructors
		
        public OgreSkeletonReader(Stream data) : base(data) {
        }
		
        #endregion
		
        #region Methods
		
        public void Import(Skeleton skeleton) {
            // store a local reference to the mesh for modification
            this.skeleton = skeleton;

            // start off by taking a look at the header
            ReadFileHeader();

            try {
                SkeletonChunkID chunkID = 0;

                bool parse = true;
				
                while(parse) {
                    chunkID = ReadChunk();

                    switch(chunkID) {
                        case SkeletonChunkID.Bone:
                            ReadBone();
                            break;

                        case SkeletonChunkID.BoneParent:
                            ReadBoneParent();
                            break;

                        case SkeletonChunkID.Animation:
                            ReadAnimation();
                            break;

                        default:
                            System.Diagnostics.Trace.Write("Can only parse bones, parents, and animations at the top level during skeleton loading.");
                            parse = false;
                            break;
                    } // switch
                } // while
            }
            catch(EndOfStreamException) {
                skeleton.DumpContents(@"D:\skeleton.txt");

                // assume bones are stored in binding pose
                skeleton.SetBindingPose();
            }
        }

        /// <summary>
        ///    Reads animation information from the file.
        /// </summary>
        protected void ReadAnimation() {
            // name of the animation
            string name = ReadString('\n');

            // length in seconds of the animation
            float length = ReadSingle();

            // create an animation from the skeleton
            Animation anim = skeleton.CreateAnimation(name, length);

            // read the first chunk
            SkeletonChunkID chunkId = ReadChunk();

            // continue while we still have animation tracks to read
            while(chunkId == SkeletonChunkID.AnimationTrack) {
                // read the animation track
                ReadAnimationTrack(anim);
<commit_msg>Removed debug skeleton dump.<commit_after>using System;
using System.IO;
using System.Text;
using Axiom.Animating;
using Axiom.MathLib;

namespace Axiom.Serialization {
    /// <summary>
    /// 	Summary description for OgreSkeletonReader.
    /// </summary>
    public class OgreSkeletonReader : BinaryReader {
        #region Member variables
		
        const int CHUNK_OVERHEAD_SIZE = 6;
        const string VERSION = "[Serializer_v1.10]";

        private Skeleton skeleton;
        private int currentChunkLength;

        #endregion
		
        #region Constructors
		
        public OgreSkeletonReader(Stream data) : base(data) {
        }
		
        #endregion
		
        #region Methods
		
        public void Import(Skeleton skeleton) {
            // store a local reference to the mesh for modification
            this.skeleton = skeleton;

            // start off by taking a look at the header
            ReadFileHeader();

            try {
                SkeletonChunkID chunkID = 0;

                bool parse = true;
				
                while(parse) {
                    chunkID = ReadChunk();

                    switch(chunkID) {
                        case SkeletonChunkID.Bone:
                            ReadBone();
                            break;

                        case SkeletonChunkID.BoneParent:
                            ReadBoneParent();
                            break;

                        case SkeletonChunkID.Animation:
                            ReadAnimation();
                            break;

                        default:
                            System.Diagnostics.Trace.Write("Can only parse bones, parents, and animations at the top level during skeleton loading.");
                            parse = false;
                            break;
                    } // switch
                } // while
            }
            catch(EndOfStreamException) {
                // assume bones are stored in binding pose
                skeleton.SetBindingPose();
            }
        }

        /// <summary>
        ///    Reads animation information from the file.
        /// </summary>
        protected void ReadAnimation() {
            // name of the animation
            string name = ReadString('\n');

            // length in seconds of the animation
            float length = ReadSingle();

            // create an animation from the skeleton
            Animation anim = skeleton.CreateAnimation(name, length);

            // read the first chunk
            SkeletonChunkID chunkId = ReadChunk();

            // continue while we still have animation tracks to read
            while(chunkId == SkeletonChunkID.AnimationTrack) {
                // read the animation track
                ReadAnimationTrack(anim);

{'fraction_non_alphanumeric': 0.07002998765214323, 'fraction_numerical': 0.0017639795378373612, 'mean_word_length': 1.2607655502392345, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2487237', 'n_tokens_mistral': 1357, 'n_tokens_neox': 1226, 'n_words': 376}