Beispiel #1
0
        void FixCommas()
        {
            DefinitiveName = DefinitiveName.Replace(", The", ""); // strip out supurflous "the"
            int pos = DefinitiveName.IndexOf(",");

            if (pos > 0)
            {
                DefinitiveName = (DefinitiveName.Substring(pos + 1) + " " + DefinitiveName.Substring(0, pos)).Trim();
            }
        }
Beispiel #2
0
        void FixAbbreviations()
        {
            DefinitiveName = DefinitiveName.Trim();
            if (DefinitiveName.EndsWith(" Fm")) // Fm is abbreviation for Farm
            {
                DefinitiveName = DefinitiveName.Replace(" Fm", " Farm");
            }
            if (DefinitiveName.EndsWith(" fm")) // Fm is abbreviation for Farm
            {
                DefinitiveName = DefinitiveName.Replace(" fm", " Farm");
            }
            if (DefinitiveName.EndsWith(" Fms")) // Fm is abbreviation for Farm
            {
                DefinitiveName = DefinitiveName.Replace(" Fms", " Farm");
            }
            if (DefinitiveName.EndsWith(" Ct")) // Ct is abbreviation for Court
            {
                DefinitiveName = DefinitiveName.Replace(" Ct", " Court");
            }
            if (DefinitiveName.EndsWith(" Pt")) // Pt is abbreviation for Point
            {
                DefinitiveName = DefinitiveName.Replace(" Pt", " Point");
            }
            ;
            if (DefinitiveName.EndsWith(" Pk")) // Pt is abbreviation for Park
            {
                DefinitiveName = DefinitiveName.Replace(" Pk", " Park");
            }
            ;
            if (DefinitiveName.EndsWith(" Rly")) // Pt is abbreviation for Park
            {
                DefinitiveName = DefinitiveName.Replace(" Rly", " Railway");
            }
            ;
            if (DefinitiveName.EndsWith(" Sq")) // Sq is abbreviation for Square
            {
                DefinitiveName = DefinitiveName + "uare";
            }
            if (DefinitiveName.EndsWith(" Sch")) // Sch is abbreviation for School
            {
                DefinitiveName = DefinitiveName + "ool";
            }
            if (DefinitiveName.EndsWith(" Ho")) // Ho is abbreviation for House
            {
                DefinitiveName = DefinitiveName + "use";
            }
            if (DefinitiveName.EndsWith(" St")) // St is abbreviation for Street
            {
                DefinitiveName = DefinitiveName + "reet";
            }
            if (DefinitiveName.EndsWith(" Sta")) // Sta is abbreviation for Station
            {
                DefinitiveName = DefinitiveName + "tion";
            }
            if (DefinitiveName.EndsWith(" Br")) // Br is abbreviation for Bridge
            {
                DefinitiveName = DefinitiveName + "idge";
            }
            if (DefinitiveName.EndsWith(" Ch")) // Ch is abbreviation for Church
            {
                DefinitiveName = DefinitiveName + "urch";
            }
            if (DefinitiveName.EndsWith(" Pl")) // Pl is abbreviation for Place
            {
                DefinitiveName = DefinitiveName + "ace";
            }
            if (DefinitiveName.EndsWith(" Ave")) // Ave is abbreviation for Avenue
            {
                DefinitiveName = DefinitiveName + "nue";
            }
            if (DefinitiveName.EndsWith(" The")) // we can strip trailing the's
            {
                DefinitiveName = DefinitiveName.Substring(DefinitiveName.Length - 4);
            }

            if (DefinitiveName.Contains("("))
            {
                Match match = slash.Match(DefinitiveName);
                if (match.Success)
                {
                    DefinitiveName = match.Groups[1].ToString().Trim();
                }
            }
            if (ParishName.Contains("("))
            {
                Match match = slash.Match(ParishName);
                if (match.Success)
                {
                    ParishName = match.Groups[1].ToString().Trim();
                }
            }
        }