Beispiel #1
0
        private NameAnalysisResult AnalyseFamilyName(String nameStr)
        {
            NameAnalysisResult result = new FragmentResult(nameStr);

            // try to find the name in the database
            Name name = this.context.Lookup(nameStr);

            if (name != null)
            {
                // filter out surname cases
                var givenNameUses = name.Usage.Where(x => x.FamilyName);

                // should we filter by culture, too?
                if (this.options.CultureHint != null)
                {
                    givenNameUses = givenNameUses.Where(
                        x => x.CultureName.Equals(this.options.CultureHint.Name));
                }

                if (givenNameUses.Count() == 0)
                    return result;

                result = new FamilyNameResult(name, givenNameUses.ToList());
            }

            return result;
        }
Beispiel #2
0
        private NameAnalysisResult AnalyseFamilyName(String nameStr)
        {
            NameAnalysisResult result = new FragmentResult(nameStr);

            // try to find the name in the database
            Name name = this.context.Lookup(nameStr);

            if (name != null)
            {
                // filter out surname cases
                var givenNameUses = name.Usage.Where(x => x.FamilyName);

                // should we filter by culture, too?
                if (this.options.CultureHint != null)
                {
                    givenNameUses = givenNameUses.Where(
                        x => x.CultureName.Equals(this.options.CultureHint.Name));
                }

                if (givenNameUses.Count() == 0)
                {
                    return(result);
                }

                result = new FamilyNameResult(name, givenNameUses.ToList());
            }

            return(result);
        }