public EssenceItem(string value, string prof, TypeAttributeValue type)
        {
            value.ThrowIfEmptyOrNull("value");

            Value = EntityNormalizer.Normalize(value);
            Prof  = !prof.IsEmptyOrNull() ? EntityNormalizer.Normalize(prof) : null;
            Type  = type.IsLinguisticsCompability()
                                        ? type.ToString().ToEnum <EntityType>()
                                        : EntityType.Unknown;
        }
Example #2
0
        public static bool IsLinguisticsCompability(this TypeAttributeValue value)
        {
            switch (value)
            {
            case TypeAttributeValue.Collocation:
            case TypeAttributeValue.Participial:
            case TypeAttributeValue.DanglingParticiple:
            case TypeAttributeValue.Subordinate:
            case TypeAttributeValue.Inquiry:
                return(false);

            default:
                return(true);
            }
        }
Example #3
0
        public static void SetAttributeTYPE(this XElement element, TypeAttributeValue type)
        {
            //if ( !element.IsElementU() )
            //if ( element.HasAttribute( Consts.TYPE_ATTRIBUTE ) )
            {
                if (type == TypeAttributeValue.Inquiry)
                {
                    if (!element.HasAttribute(Consts.TYPE_SAVED_ATTRIBUTE))
                    {
                        var typesaved = element.GetAttributeTYPE();
                        if (typesaved.HasValue && typesaved.Value.IsLinguisticsCompability())
                        {
                            element.SetAttributeTYPESAVED(typesaved.Value);
                        }
                    }
                }

                element.SetAttribute(Consts.TYPE_ATTRIBUTE, type.ToString());
            }
        }
Example #4
0
 public static bool HasTypeAttributeValue(this XElement element, TypeAttributeValue type)
 {
     return(element.HasAttributeWithValue(Consts.TYPE_ATTRIBUTE, type.ToString()));
 }
Example #5
0
 public static void SetAttributeTYPESAVED(this XElement element, TypeAttributeValue type)
 {
     element.SetAttribute(Consts.TYPE_SAVED_ATTRIBUTE, type.ToString());
 }