Exemplo n.º 1
0
        void AddParentAndChildrenFacts(Individual child, Individual parent, ParentalRelationship.ParentalRelationshipType prType)
        {
            if (parent != null)
            {
                string parentComment;
                string childrenComment;
                if (prType == ParentalRelationship.ParentalRelationshipType.UNKNOWN)
                {
                    parentComment   = $"Child of {parent.IndividualID}: {parent.Name}";
                    childrenComment = $"Parent of {child.IndividualID}: {child.Name}";
                }
                else
                {
                    string titlecase = EnhancedTextInfo.ToTitleCase(prType.ToString().ToLower());
                    parentComment   = $"{titlecase}  child of {parent.IndividualID}: {parent.Name}";
                    childrenComment = $"{titlecase} parent of {child.IndividualID}: {child.Name}";
                }

                Fact parentFact = new Fact(parent.IndividualID, Fact.PARENT, child.BirthDate, child.BirthLocation, parentComment, true, true);
                child.AddFact(parentFact);

                Fact childrenFact = new Fact(child.IndividualID, Fact.CHILDREN, child.BirthDate, child.BirthLocation, childrenComment, true, true);
                parent.AddFact(childrenFact);
            }
        }
Exemplo n.º 2
0
        public OS50kGazetteer(string line)
        {
            line = EnhancedTextInfo.RemoveDiacritics(line); // remove any special characters for Gazatteer processing
            string[] values = line.Split(':');
            int.TryParse(values[0], out int intval);
            SequenceNumber = intval;
            DefinitiveName = values[2];
            int.TryParse(values[4], out intval);
            double.TryParse(values[5], out double latitude);
            Latitude = intval + latitude / 60;
            int.TryParse(values[6], out intval);
            double.TryParse(values[7], out double longitude);
            Longitude = intval + longitude / 60;
            if (values[10] == "W")
            {
                Longitude = -1 * Longitude; // West Longitudes are negative
            }
            Coordinate c = new Coordinate(Longitude, Latitude);

            c     = MapTransforms.TransformCoordinate(c);
            Point = GeometryFactory.Default.CreatePoint(c);

            CountyCode  = values[11];
            CountyName  = values[13];
            FeatureCode = values[14];
            ParishName  = values[20];
            if (ParishName.EndsWith(" CP"))
            {
                ParishName = ParishName.Substring(0, ParishName.Length - 3);
            }
            if (ParishName.EndsWith(" Community"))
            {
                ParishName = ParishName.Substring(0, ParishName.Length - 10);
            }
            FixCommas();
            FixAbbreviations();
            ModernCounty county = Regions.OS_GetCounty(CountyCode);

            if (county == null)
            {
                CountryName = string.Empty;
            }
            else
            {
                CountryName = county.CountryName;
                DoubleMetaphone meta = new DoubleMetaphone(DefinitiveName);
                FuzzyMatch         = meta.PrimaryKey + ":";
                FuzzyNoParishMatch = meta.PrimaryKey + ":";
                meta               = new DoubleMetaphone(ParishName);
                FuzzyMatch        += meta.PrimaryKey + ":";
                meta               = new DoubleMetaphone(CountyName);
                FuzzyMatch        += meta.PrimaryKey + ":";
                FuzzyNoParishMatch = meta.PrimaryKey + ":";
                meta               = new DoubleMetaphone(county.CountryName);
                FuzzyMatch        += meta.PrimaryKey;
                FuzzyNoParishMatch = meta.PrimaryKey + ":";
            }
        }
Exemplo n.º 3
0
 private void SetCommentAndLocation(string factType, string factComment, string factPlace, string latitude, string longitude)
 {
     if (factComment.Length == 0 && factPlace.Length > 0)
     {
         if (factPlace.EndsWith("/"))
         {
             Comment = factPlace.Substring(0, factPlace.Length - 1);
             Place   = string.Empty;
         }
         else
         {
             int slash = factPlace.IndexOf("/");
             if (slash >= 0)
             {
                 Comment = factPlace.Substring(0, slash).Trim();
                 // If slash occurs at end of string, location is empty.
                 Place = (slash == factPlace.Length - 1) ? string.Empty : factPlace.Substring(slash + 1).Trim();
             }
             else if (Fact.COMMENT_FACTS.Contains(factType))
             {
                 // we have a comment rather than a location
                 Comment = factPlace;
                 Place   = string.Empty;
             }
             else
             {
                 Comment = string.Empty;
                 Place   = factPlace;
             }
         }
     }
     else
     {
         Comment = factComment;
         Place   = factPlace;
         if (factType == NAME)
         {
             Comment = Comment.Replace("/", "");
         }
     }
     Comment = EnhancedTextInfo.ToTitleCase(Comment).Trim();
     if (Properties.GeneralSettings.Default.ReverseLocations)
     {
         Location = FactLocation.GetLocation(ReverseLocation(Place), latitude, longitude, FactLocation.Geocode.NOT_SEARCHED);
     }
     else
     {
         Location = FactLocation.GetLocation(Place, latitude, longitude, FactLocation.Geocode.NOT_SEARCHED);
     }
 }
Exemplo n.º 4
0
        internal static string GetFactTypeDescription(string factType)
        {
            switch (factType)
            {
            case NAME: return("Alternate Name");

            case ALIAS: return("Also known as");

            case ADOPTION: return("Adoption");

            case ANNULMENT: return("Annulment");

            case BAPTISM: return("Baptism");

            case BAR_MITZVAH: return("Bar mitzvah");

            case BAS_MITZVAH: return("Bas mitzvah");

            case BIRTH: return("Birth");

            case BIRTH_CALC: return("Birth (Calc from Age)");

            case BLESSING: return("Blessing");

            case BURIAL: return("Burial");

            case CENSUS: return("Census");

            case CENSUS_FTA: return("Census (FTAnalyzer)");

            case CHRISTENING: return("Christening");

            case ADULT_CHRISTENING: return("Adult christening");

            case CONFIRMATION: return("Confirmation");

            case CREMATION: return("Cremation");

            case DEATH: return("Death");

            case PHYSICAL_DESC: return("Physical description");

            case DIVORCE: return("Divorce");

            case DIVORCE_FILED: return("Divorce filed");

            case EDUCATION: return("Education");

            case EMIGRATION: return("Emigration");

            case ENGAGEMENT: return("Engagement");

            case FIRST_COMMUNION: return("First communion");

            case GRADUATION: return("Graduation");

            case IMMIGRATION: return("Immigration");

            case NAT_ID_NO: return("National identity no.");

            case NATIONAL_TRIBAL: return("Nationality");

            case NUM_CHILDREN: return("Number of children");

            case NUM_MARRIAGE: return("Number of marriages");

            case LEGATEE: return("Legatee");

            case MARRIAGE_BANN: return("Marriage banns");

            case MARR_CONTRACT: return("Marriage contract");

            case MARR_LICENSE: return("Marriage license");

            case MARRIAGE: return("Marriage");

            case MARR_SETTLEMENT: return("Marriage settlement");

            case NATURALIZATION: return("Naturalization");

            case OCCUPATION: return("Occupation");

            case PROPERTY: return("Property");

            case ORDINATION: return("Ordination");

            case PROBATE: return("Probate");

            case RESIDENCE: return("Residence");

            case RETIREMENT: return("Retirement");

            case WILL: return("Will");

            case SEPARATION: return("Separation");

            case MILITARY: return("Military service");

            case SERVICE_NUMBER: return("Military service number");

            case ELECTION: return("Election");

            case DEGREE: return("Degree");

            case EMPLOYMENT: return("Employment");

            case MEDICAL_CONDITION: return("Medical condition");

            case CHILDLESS: return("Childless");

            case UNMARRIED: return("Unmarried");

            case WITNESS: return("Witness");

            case LOOSEDEATH: return("Loose death");

            case LOOSEBIRTH: return("Loose birth");

            case FAMILYSEARCH: return("Familysearch");

            case CONTACT: return("Contact");

            case ARRIVAL: return("Arrival");

            case DEPARTURE: return("Departure");

            case CHANGE: return("Record change");

            case LOSTCOUSINS: return("Lost Cousins");

            case LC_FTA: return("Lost Cousins (FTAnalyzer)");

            case DIED_SINGLE: return("Died Single");

            case UNKNOWN: return("UNKNOWN");

            case PARENT: return("Parental Info");

            case CHILDREN: return("Child Born");

            case REFERENCE: return("Reference ID");

            case MISSING: return("Missing");

            case CHILDREN1911: return("Children Status");

            case REPORT: return("Fact Report");

            case CUSTOM_EVENT: return("Event");

            case WORLD_EVENT: return("World Event");

            case "": return("UNKNOWN");

            default: return(EnhancedTextInfo.ToTitleCase(factType));
            }
        }