예제 #1
0
 /// <inheritdoc />
 public string GetForm(PronounForm form)
 {
     return(form switch
     {
         PronounForm.Subject => GetSubjectForm(),
         PronounForm.SubjectVerb => GetSubjectForm(true),
         PronounForm.Object => GetObjectForm(),
         PronounForm.PossessiveAdjective => GetPossessiveAdjectiveForm(),
         PronounForm.Possessive => GetPossessiveForm(),
         PronounForm.PossessiveVerb => GetPossessiveForm(true),
         PronounForm.Reflexive => GetReflexiveForm(),
         _ => throw new ArgumentOutOfRangeException(nameof(form), form, null)
     });
예제 #2
0
        /// <inheritdoc />
        protected override PronounToken Initialize(string data)
        {
            if (data is null)
            {
                return(this);
            }

            if (Enum.TryParse <PronounForm>(data, true, out var result))
            {
                this.Form = result;
            }

            return(this);
        }
예제 #3
0
        /// <inheritdoc />
        protected override FluentPronounToken Initialize(string?data)
        {
            if (data is null)
            {
                this.Form = PronounForm.Subject;
                return(this);
            }

            if (data.Equals("they", StringComparison.OrdinalIgnoreCase))
            {
                this.Form = PronounForm.Subject;
            }

            if (data.Equals("they are", StringComparison.OrdinalIgnoreCase))
            {
                this.Form = PronounForm.SubjectVerb;
            }

            if (data.Equals("them", StringComparison.OrdinalIgnoreCase))
            {
                this.Form = PronounForm.Object;
            }

            if (data.Equals("their", StringComparison.OrdinalIgnoreCase))
            {
                this.Form = PronounForm.PossessiveAdjective;
            }

            if (data.Equals("they have", StringComparison.OrdinalIgnoreCase))
            {
                this.Form = PronounForm.PossessiveVerb;
            }

            if (data.Equals("theirs", StringComparison.OrdinalIgnoreCase))
            {
                this.Form = PronounForm.Possessive;
            }

            if (data.Equals("themselves", StringComparison.OrdinalIgnoreCase))
            {
                this.Form = PronounForm.Reflexive;
            }

            return(this);
        }
예제 #4
0
        /// <inheritdoc />
        public string GetForm(PronounForm form)
        {
            switch (form)
            {
            case PronounForm.Subject:
            {
                return(GetSubjectForm());
            }

            case PronounForm.SubjectVerb:
            {
                return(GetSubjectForm(true));
            }

            case PronounForm.Object:
            {
                return(GetObjectForm());
            }

            case PronounForm.PossessiveAdjective:
            {
                return(GetPossessiveAdjectiveForm());
            }

            case PronounForm.Possessive:
            {
                return(GetPossessiveForm());
            }

            case PronounForm.PossessiveVerb:
            {
                return(GetPossessiveForm(true));
            }

            case PronounForm.Reflexive:
            {
                return(GetReflexiveForm());
            }

            default:
            {
                throw new ArgumentOutOfRangeException(nameof(form), form, null);
            }
            }
        }