示例#1
0
        private static void SubstituteAltInputName(
            Location location,
            GazetteerNames gazetteerNames)
        {
            if (!string.IsNullOrEmpty(location.Name1))
            {
                string main = gazetteerNames.GetMainLevel1(location.Name1);
                if (!string.IsNullOrEmpty(main))
                {
                    location.Name1 = main;
                }
            }

            if (!string.IsNullOrEmpty(location.Name2))
            {
                string main = gazetteerNames.GetMainLevel2(location.Name1, location.Name2);
                if (!string.IsNullOrEmpty(main))
                {
                    location.Name2 = main;
                }
            }

            if (!string.IsNullOrEmpty(location.Name3))
            {
                string main = gazetteerNames.GetMainLevel3(
                    location.Name1,
                    location.Name2,
                    location.Name3);
                if (!string.IsNullOrEmpty(main))
                {
                    location.Name3 = main;
                }
            }
        }
示例#2
0
        private static void SubstituteAltGazetteerName(
            Location location,
            GazetteerNames gazetteerNames)
        {
            if (!string.IsNullOrEmpty(location.Name1))
            {
                string main = gazetteerNames.GetMainLevel1(location.Name1);
                if (main == null)
                {
                    throw new ArgumentException(
                              string.Format(
                                  "Location match not in in the gazetteer[{0}",
                                  location.Name1),
                              "location");
                }
                location.Name1 = main;
            }

            if (!string.IsNullOrEmpty(location.Name2))
            {
                string main =
                    gazetteerNames.GetMainLevel2(location.Name1, location.Name2);
                if (main == null)
                {
                    throw new ArgumentException(
                              string.Format(
                                  "Location match not in in the gazetteer[{0}",
                                  location.Name2),
                              "location");
                }
                location.Name2 = main;
            }

            if (!string.IsNullOrEmpty(location.Name3))
            {
                string main =
                    gazetteerNames.GetMainLevel3(
                        location.Name1,
                        location.Name2,
                        location.Name3);
                if (main == null)
                {
                    throw new ArgumentException(
                              string.Format(
                                  "Location match not in in the gazetteer[{0}",
                                  location.Name3),
                              "location");
                }
                location.Name3 = main;
            }
        }
示例#3
0
        private static void SubstituteAltInputName(
            Location location,
            GazetteerNames gazetteerNames)
        {
            if (!string.IsNullOrEmpty(location.Name1))
            {
                string main = gazetteerNames.GetMainLevel1(location.Name1);
                if (!string.IsNullOrEmpty(main))
                {
                    location.Name1 = main;
                }
            }

            if (!string.IsNullOrEmpty(location.Name2))
            {
                string main = gazetteerNames.GetMainLevel2(location.Name1, location.Name2);
                if (!string.IsNullOrEmpty(main))
                {
                    location.Name2 = main;
                }
            }

            if (!string.IsNullOrEmpty(location.Name3))
            {
                string main = gazetteerNames.GetMainLevel3(
                    location.Name1,
                    location.Name2,
                    location.Name3);
                if (!string.IsNullOrEmpty(main))
                {
                    location.Name3 = main;
                }
            }
        }
示例#4
0
        private static void SubstituteAltGazetteerName(
            Location location,
            GazetteerNames gazetteerNames)
        {
            if (!string.IsNullOrEmpty(location.Name1))
            {
                string main = gazetteerNames.GetMainLevel1(location.Name1);
                if (main == null)
                {
                    throw new ArgumentException(
                        string.Format(
                            "Location match not in in the gazetteer[{0}",
                            location.Name1),
                        "location");
                }
                location.Name1 = main;
            }

            if (!string.IsNullOrEmpty(location.Name2))
            {
                string main =
                    gazetteerNames.GetMainLevel2(location.Name1, location.Name2);
                if (main == null)
                {
                    throw new ArgumentException(
                        string.Format(
                            "Location match not in in the gazetteer[{0}",
                            location.Name2),
                        "location");
                }
                location.Name2 = main;
            }

            if (!string.IsNullOrEmpty(location.Name3))
            {
                string main =
                    gazetteerNames.GetMainLevel3(
                        location.Name1,
                        location.Name2,
                        location.Name3);
                if (main == null)
                {
                    throw new ArgumentException(
                        string.Format(
                            "Location match not in in the gazetteer[{0}",
                            location.Name3),
                        "location");
                }
                location.Name3 = main;
            }
        }