<commit_before>//
//  MetadataFieldDescriptor.cs
//  s.im.pl serialization
//
//  Generated by DotNetTranslator on 11/16/10.
//  Copyright 2010 Interface Ecology Lab. 
//

using System;
using System.Collections.Generic;
using ecologylabSemantics.ecologylab.semantics.metadata;
using Simpl.Serialization.Attributes;
using Simpl.Serialization;
using System.Reflection;
using ecologylab.semantics.metametadata;

namespace ecologylab.semantics.metadata 
{
	/// <summary>
	/// missing java doc comments or could not find the source file.
	/// </summary>
	public class MetadataFieldDescriptor : FieldDescriptor
	{
		/// <summary>
		/// missing java doc comments or could not find the source file.
		/// </summary>
		[SimplScalar]
		private String mmName;

        public MetadataFieldDescriptor(MetadataClassDescriptor classDescriptor, FieldInfo fieldInfo, Int16 annotationType) : base(classDescriptor, fieldInfo, annotationType)
        { 
            MmName = DeriveMmName();
        }

        public MetadataFieldDescriptor(MetadataClassDescriptor declaringClassDescriptor, FieldDescriptor wrappedFD, String wrapperTag)
            : base(declaringClassDescriptor, wrappedFD, wrapperTag)
        {
            //MmName = DeriveMmName();
        }

		public String MmName
		{
			get{return mmName;}
			set{mmName = value;}
		}


	    private String DeriveMmName()
        {
            String result	= null;
		
            FieldInfo thatField = this.Field;
            foreach (CustomAttributeData cad in thatField.GetCustomAttributesData())
            {
                if (cad.Constructor.DeclaringType == typeof(ecologylab.semantics.metadata.MmName))
                {
                    result = (String) cad.ConstructorArguments[0].Value;
                    break;
                }
            }

            if (result == null)
            {
                result = "";//TODO FIXME XMLTools.GetXmlTagName(thatField.Name, null);
                //if (!this.IsScalar)
                    //System.Console.WriteLine("Missing @mm_name annotation for " + thatField + "\tusing " + result);
            }

            
            return result;
        }

        public IMetadata GetNestedMetadata(IMetadata context)
	    {
		    return IsScalar ? null : (IMetadata) GetNested(context);
	    }
	}
}
<commit_msg>added (memberwise/shadow) clone method for MetadataFieldDescriptor.<commit_after>//
//  MetadataFieldDescriptor.cs
//  s.im.pl serialization
//
//  Generated by DotNetTranslator on 11/16/10.
//  Copyright 2010 Interface Ecology Lab. 
//

using System;
using System.Collections.Generic;
using ecologylabSemantics.ecologylab.semantics.metadata;
using Simpl.Serialization.Attributes;
using Simpl.Serialization;
using System.Reflection;
using ecologylab.semantics.metametadata;

namespace ecologylab.semantics.metadata 
{
	/// <summary>
	/// missing java doc comments or could not find the source file.
	/// </summary>
	public class MetadataFieldDescriptor : FieldDescriptor
	{
		/// <summary>
		/// missing java doc comments or could not find the source file.
		/// </summary>
		[SimplScalar]
		private String mmName;

        public MetadataFieldDescriptor(MetadataClassDescriptor classDescriptor, FieldInfo fieldInfo, Int16 annotationType) : base(classDescriptor, fieldInfo, annotationType)
        { 
            MmName = DeriveMmName();
        }

        public MetadataFieldDescriptor(MetadataClassDescriptor declaringClassDescriptor, FieldDescriptor wrappedFD, String wrapperTag)
            : base(declaringClassDescriptor, wrappedFD, wrapperTag)
        {
            //MmName = DeriveMmName();
        }

		public String MmName
		{
			get{return mmName;}
			set{mmName = value;}
		}


	    private String DeriveMmName()
        {
            String result	= null;
		
            FieldInfo thatField = this.Field;
            foreach (CustomAttributeData cad in thatField.GetCustomAttributesData())
            {
                if (cad.Constructor.DeclaringType == typeof(ecologylab.semantics.metadata.MmName))
                {
                    result = (String) cad.ConstructorArguments[0].Value;
                    break;
                }
            }

            if (result == null)
            {
                result = "";//TODO FIXME XMLTools.GetXmlTagName(thatField.Name, null);
                //if (!this.IsScalar)
                    //System.Console.WriteLine("Missing @mm_name annotation for " + thatField + "\tusing " + result);
            }

            
            return result;
        }

        public IMetadata GetNestedMetadata(IMetadata context)
	    {
		    return IsScalar ? null : (IMetadata) GetNested(context);
	    }

        private MetadataFieldDescriptor clonedFrom;

        public MetadataFieldDescriptor Clone()
        {
            MetadataFieldDescriptor result = this.MemberwiseClone();
            result.clonedFrom = this;
            return result;
        }

	}
}

{'fraction_non_alphanumeric': 0.08832305550029838, 'fraction_numerical': 0.00517207081758504, 'mean_word_length': 2.1210428305400373, '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': '4936509', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1294, 'n_words': 306}