public override void Initialize()
        {
            Name = "In Swiss Cheese Room";
            Synonyms.Are("swiss", "cheese", "room");
            Description =
                "You are in a room whose walls resemble swiss cheese. " +
                "Obvious passages go west, east, ne, and nw. " +
                "Part of the room is occupied by a large bedrock block.";

            WestTo <EastEndOfTwoPitRoom>();
            SouthTo <TallEWCanyon>();
            NorthEastTo <Bedquilt>();
            NorthWestTo <OrientalRoom>();
            EastTo <SoftRoom>();

            Before <Go>((Direction direction) =>
            {
                if ((direction is South && Random.Number(1, 100) <= 80) ||
                    (direction is Northwest && Random.Number(1, 100) <= 50))
                {
                    Print("You have crawled around in some little holes and wound up back in the main passage.");
                    return(true);
                }

                return(false);
            });
        }
Example #2
0
        public override void Initialize()
        {
            Name = "In West Pit";

            Synonyms.Are("in", "west", "pit");

            Description =
                "You are at the bottom of the western pit in the twopit room. " +
                "There is a large hole in the wall about 25 feet above you.";

            NoDwarf = true;

            Before <Climb>(() =>
            {
                if (Noun is Plant)
                {
                    return(false);
                }

                var plant = Objects.Get <Plant>();

                if (plant.Height == PlantSize.Tiny)
                {
                    Print("There is nothing here to climb. Use \"up\" or \"out\" to leave the pit.");
                    return(true);
                }

                return(false);
            });

            UpTo <WestEndOfTwoPitRoom>();
        }
Example #3
0
        public async void getAntonyms()
        {
            string lang;

            if (SelectedInput.Equals("English"))
            {
                lang = "en";
            }
            else
            {
                lang = " ";
            }
            var uri = "/api/v1/entries/" + lang + "/" + Word + "/antonyms";

            if (SelectedInput == null)
            {
                DependencyService.Get <IMessage>().LongAlert("Please select language!");
            }
            else
            {
                AntResult = await service.GetSynonymsAsync(uri);

                if (AntResult != null)
                {
                    setAntonymValues();
                }
                else
                {
                    Antonyms.Clear();
                }
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="key"></param>
        /// <param name="cultureInfo"></param>
        /// <returns></returns>
        public string Get(string key, CultureInfo cultureInfo)
        {
            if (Synonyms == null)
            {
                return(key);
            }

            cultureInfo = cultureInfo ?? CultureService.GetCulture();
            var synonymInfo = Synonyms.ToList().FirstOrDefault(f => f.Key == key);

            if (synonymInfo == null)
            {
                return(key);
            }

            if (Equals(CultureHelper.UzLanguage, cultureInfo))
            {
                return(synonymInfo.Uz);
            }

            if (Equals(CultureHelper.RuLanguage, cultureInfo))
            {
                return(synonymInfo.Ru);
            }

            if (Equals(CultureHelper.EnLanguage, cultureInfo))
            {
                return(synonymInfo.En);
            }

            return(key);
        }
 public void Test1()
 {
     var synonyms = new Synonyms(new Dictionary<string, string>());
     synonyms.Add("mssql", "ms-sql");
     var result = synonyms.FindCoreSynonym("mssql");
     Assert.AreEqual("mssql", result);
 }
Example #6
0
        /*public List<ISchemaBase> FindAllByColumn(String ColumnName)
         * {
         *  this.t
         * }*/

        public override SQLScriptList ToSqlDiff()
        {
            var listDiff = new SQLScriptList();

            listDiff.Add("USE [" + Name + "]\r\nGO\r\n\r\n", 0, Enums.ScripActionType.UseDatabase);
            listDiff.AddRange(Assemblies.ToSqlDiff());
            listDiff.AddRange(Defaults.ToSqlDiff());
            listDiff.AddRange(UserTypes.ToSqlDiff());
            listDiff.AddRange(TablesTypes.ToSqlDiff());
            listDiff.AddRange(Tables.ToSqlDiff());
            listDiff.AddRange(Rules.ToSqlDiff());
            listDiff.AddRange(Schemas.ToSqlDiff());
            listDiff.AddRange(XmlSchemas.ToSqlDiff());
            listDiff.AddRange(Procedures.ToSqlDiff());
            listDiff.AddRange(CLRProcedures.ToSqlDiff());
            listDiff.AddRange(CLRFunctions.ToSqlDiff());
            listDiff.AddRange(FileGroups.ToSqlDiff());
            listDiff.AddRange(DDLTriggers.ToSqlDiff());
            listDiff.AddRange(Synonyms.ToSqlDiff());
            listDiff.AddRange(Views.ToSqlDiff());
            listDiff.AddRange(Users.ToSqlDiff());
            listDiff.AddRange(Functions.ToSqlDiff());
            listDiff.AddRange(Roles.ToSqlDiff());
            listDiff.AddRange(PartitionFunctions.ToSqlDiff());
            listDiff.AddRange(PartitionSchemes.ToSqlDiff());
            listDiff.AddRange(FullText.ToSqlDiff());
            return(listDiff);
        }
Example #7
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Synonyms != null && Synonyms.Any())
     {
         writer.WritePropertyName("synonyms");
         writer.WriteStartArray();
         foreach (var item in Synonyms)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (IgnoreCase != null)
     {
         writer.WritePropertyName("ignoreCase");
         writer.WriteBooleanValue(IgnoreCase.Value);
     }
     if (Expand != null)
     {
         writer.WritePropertyName("expand");
         writer.WriteBooleanValue(Expand.Value);
     }
     writer.WritePropertyName("@odata.type");
     writer.WriteStringValue(ODataType);
     writer.WritePropertyName("name");
     writer.WriteStringValue(Name);
     writer.WriteEndObject();
 }
Example #8
0
        public override void Initialize()
        {
            Name = "Alcove";

            Synonyms.Are("alcove");

            Description =
                "You are in an alcove. " +
                "A small northwest path seems to widen after a short distance. " +
                "An extremely tight tunnel leads east. " +
                "It looks like a very tight squeeze. " +
                "An eerie light can be seen at the other end.";

            NorthWestTo <MistyCavern>();

            EastTo(() =>
            {
                var carrying = Inventory.Items.Count;

                if (carrying == 0 || carrying == 1 && IsCarrying <EggSizedEmerald>())
                {
                    return(Room <PloverRoom>());
                }

                Print("Something you're carrying won't fit through the tunnel with you. You'd best take inventory and drop something.");
                return(this);
            });
        }
Example #9
0
 public override void Initialize()
 {
     Name = "tiny slits";
     Synonyms.Are("slit", "slits", "tiny");
     // has multitude
     FoundIn <InPit>();
 }
Example #10
0
        public override void Initialize()
        {
            Name = "Secret E/W Canyon Above Tight Canyon";
            Synonyms.Are("secret", "e/w", "canyon", "above", "tight", "canyon");
            Description =
                "You are in a secret canyon which here runs E/W. " +
                "It crosses over a very tight canyon 15 feet below. " +
                "If you go down you may not be able to get back up.";

            EastTo <HallOfMtKing>();

            WestTo <SecretCanyon>();

            DownTo <NSCanyon>();

            Before <Go>((Direction direction) =>
            {
                if (direction is West)
                {
                    Global.CanyonFrom = this;
                }

                return(false);
            });
        }
Example #11
0
        public override void Initialize()
        {
            Name = "At Window on Pit";
            Synonyms.Are("window", "on", "pit");
            Description =
                "You're at a low window overlooking a huge pit, which extends up out of sight. " +
                "A floor is indistinctly visible over 50 feet below. " +
                "Traces of white mist cover the floor of the pit, becoming thicker to the left. " +
                "Marks in the dust around the window would seem to indicate that someone has been here recently. " +
                "Directly across the pit from you and 25 feet away " +
                "there is a similar window looking into a lighted room. " +
                "A shadowy figure can be seen there peering back at you.";

            CantGo = "The only passage is back west to the junction.";

            WestTo <JunctionOfThree>();

            Before <Jump>(() =>
            {
                Print("You jump and break your neck!");
                GameOver.Dead();
                return(true);
            });

            Before <WaveHands>(() =>
            {
                Print("The shadowy figure waves back at you!");
                return(true);
            });
        }
Example #12
0
        public override void Initialize()
        {
            Name = "In Debris Room";
            Synonyms.Are("debris", "room");
            Description =
                "You are in a debris room filled with stuff washed in from the surface. " +
                "A low wide passage with cobbles becomes plugged with mud and debris here, " +
                "but an awkward canyon leads upward and west.\n\n" +
                "A note on the wall says, \"Magic word XYZZY.\"";

            EastTo <CobbleCrawl>();
            UpTo <AwkwardSlopingEWCanyon>();
            WestTo <AwkwardSlopingEWCanyon>();

            Before <Xyzzy>(() =>
            {
                L.MovePlayerTo <InsideBuilding>();
                return(true);
            });

            NoDwarf = true;

            Has <Debris>();
            Has <Cobbles>();
            Has <Note>();
        }
Example #13
0
        public override void Initialize()
        {
            Name = "dwarvish axe";
            Synonyms.Are("axe", "little", "dwarvish", "dwarven");
            InitialDescription = "There is a little axe here.";

            Before <Examine>(() =>
            {
                if (IsNearBear)
                {
                    return(false);
                }

                Print("It's lying beside the bear.");

                return(true);
            });

            Before <Take>(() =>
            {
                if (!IsNearBear)
                {
                    return(false);
                }

                Print("No chance. It's lying beside the ferocious bear, quite within harm's way.");
                return(true);
            });
        }
Example #14
0
        public override void Initialize()
        {
            Name = "At Top of Small Pit";

            Synonyms.Are("top", "of", "small", "pit");

            Description =
                "At your feet is a small pit breathing traces of white mist. " +
                "A west passage ends here except for a small crack leading on.\n\n" +
                "Rough stone steps lead down the pit.";

            NoDwarf = true;

            EastTo <BirdChamber>();

            WestTo(() =>
            {
                Print("That crack is far too small for you to follow.");
                return(this);
            });

            DownTo(() =>
            {
                if (IsCarrying <LargeGoldNugget>())
                {
                    Print("You are at the bottom of the pit with a broken neck.");
                    GameOver.Dead();
                    return(this);
                }

                return(Rooms.Get <HallOfMists>());
            });
        }
Example #15
0
 public override void Initialize()
 {
     Name = "large gold nugget";
     Synonyms.Are("gold", "nugget", "large", "heavy");
     Description        = "It's a large sparkling nugget of gold!";
     InitialDescription = "There is a large sparkling nugget of gold here!";
 }
Example #16
0
        public async Task RenderAsync(CancellationToken cancellationToken = default)
        {
            var mapper = new MainModelMapper();

            var synonymViewModels = Synonyms.Select(s => mapper.Map(s, SynonymTargets)).ToList();
            var synonymsVm        = new Synonyms(synonymViewModels);

            var renderedMain = await Formatter.RenderTemplateAsync(synonymsVm, cancellationToken).ConfigureAwait(false);

            var databaseName = !IdentifierDefaults.Database.IsNullOrWhiteSpace()
                ? IdentifierDefaults.Database + " Database"
                : "Database";
            var pageTitle     = "Synonyms ยท " + databaseName;
            var mainContainer = new Container(renderedMain, pageTitle, string.Empty);
            var renderedPage  = await Formatter.RenderTemplateAsync(mainContainer, cancellationToken).ConfigureAwait(false);

            if (!ExportDirectory.Exists)
            {
                ExportDirectory.Create();
            }
            var outputPath = Path.Combine(ExportDirectory.FullName, "synonyms.html");

            using var writer = File.CreateText(outputPath);
            await writer.WriteAsync(renderedPage.AsMemory(), cancellationToken).ConfigureAwait(false);

            await writer.FlushAsync().ConfigureAwait(false);
        }
Example #17
0
 /*
  * Verb 'go' 'run' 'walk'
  *                                           -> VagueGo
  * noun=ADirection                           -> Go
  * noun                                      -> Enter
  * 'out'                                     -> Exit
  * 'in'                                      -> GoIn
  * 'in'/'through' noun                       -> Enter;
  */
 public Go()
 {
     Name = "go";
     Synonyms.Are("walk", "run");
     // Grammars.Add(K.DIRECTION_TOKEN, ()=> false);
     //Grammars.Add(K.NOUN_TOKEN, EnterIt);
 }
Example #18
0
 public void setSynonymValues()
 {
     Synonyms.Clear();
     foreach (var i in SynResult.results)
     {
         foreach (var j in i.lexicalEntries)
         {
             var synonym = new Synonym();
             synonym.Type         = j.lexicalCategory;
             synonym.SynonymItems = "";
             foreach (var k in j.entries)
             {
                 foreach (var l in k.senses)
                 {
                     foreach (var item in l.synonyms)
                     {
                         synonym.SynonymItems += "\n" + item.text;
                         Console.WriteLine();
                     }
                 }
             }
             Synonyms.Add(synonym);
         }
     }
 }
Example #19
0
        public override void Initialize()
        {
            Name = "vending machine";
            Synonyms.Are("machine", "slot", "vending", "massive", "battery", "coin");
            Description = "The instructions on the vending machine read, \"Insert coins to receive fresh batteries.\"";

            FoundIn <DeadEnd14>();

            Receive((obj) =>
            {
                if (obj is RareCoins)
                {
                    var freshBatteries = Get <FreshBatteries>();
                    freshBatteries.MoveToLocation();
                    freshBatteries.InVendingMachine = false;

                    obj.Remove();

                    return("Soon after you insert the coins in the coin slot, the vending machine makes a grinding sound, and a set of fresh batteries falls at your feet.");
                }

                return("The machine seems to be designed to take coins.");
            });

            Before <Attack>(() => "The machine is quite sturdy and survives your attack without getting so much as a scratch.");

            Before <LookUnder>(() => "You don't find anything under the machine.");

            Before <Search>(() => "You can't get inside the machine.");

            Before <Take>(() => "The vending machine is far too heavy to move.");
        }
        public override void Initialize()
        {
            Name = "Immense N/S Passage";
            Synonyms.Are("immense", "n/s", "passage");
            Description = "You are at one end of an immense north/south passage.";

            SouthTo <GiantRoom>();

            NorthTo(() =>
            {
                var rustyDoor = Room <RustyDoor>();

                if (rustyDoor.Locked)
                {
                    Redirect <Open>(rustyDoor, v => v.Expects(rustyDoor));
                    return(this);
                }

                if (!rustyDoor.Open)
                {
                    rustyDoor.Open = true;
                    Print("(first wrenching the door open)\n");
                }

                return(rustyDoor);
            });
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="synonymInfo"></param>
 public static void AddSynonym(SynonymInfo synonymInfo)
 {
     if (synonymInfo != null)
     {
         Synonyms.Add(synonymInfo);
     }
 }
        public override void Initialize()
        {
            Name = "recent issues of \"Spelunker Today\"";
            Synonyms.Are("magazines", "magazine", "issue", "issues", "spelunker", "today");
            Description        = "I'm afraid the magazines are written in Dwarvish.";
            InitialDescription = "There are a few recent issues of ~Spelunker Today~ magazine here.";
            Article            = "a few";
            // multitude

            FoundIn <Anteroom>();

            After <Take>(() =>
            {
                if (CurrentRoom.Location is WittsEnd)
                {
                    Score.Add(-1);
                }
            });

            After <Drop>(() =>
            {
                if (CurrentRoom.Location is WittsEnd)
                {
                    Score.Add(1);
                    Print("You really are at wit's end.");
                }
            });
        }
Example #23
0
        public override void Initialize()
        {
            Name = "Atop Stalactite";
            Synonyms.Are("atop", "stalactite");
            Description =
                "A large stalactite extends from the roof and almost reaches the floor below. " +
                "You could climb down it, and jump from it to the floor, " +
                "but having done so you would be unable to reach it to climb back up.";

            NorthTo <SecretNSCanyon1>();

            DownTo(() =>
            {
                if (Random.Number(1, 100) <= 40)
                {
                    return(Rooms.Get <AlikeMaze6>());
                }
                if (Random.Number(1, 100) <= 50)
                {
                    return(Rooms.Get <AlikeMaze9>());
                }
                return(Rooms.Get <AlikeMaze4>());
            });

            Before <Climb>(() =>
            {
                MovePlayer.To(DOWN());
                return(true);
            });
        }
Example #24
0
 public override void Initialize()
 {
     Name = "cobbles";
     Synonyms.Are("cobble", "cobbles", "cobblestones", "cobblestone", "stones", "stone");
     HasPluralName = true;
     Description   = "They're just ordinary cobbles.";
 }
Example #25
0
        public override void Initialize()
        {
            Name = "Shell Room";
            Synonyms.Are("shell, room");
            Description =
                "You're in a large room carved out of sedimentary rock. " +
                "The floor and walls are littered with bits of shells imbedded in the stone. " +
                "A shallow passage proceeds downward, and a somewhat steeper one leads up. " +
                "A low hands and knees passage enters from the south.";

            UpTo <ArchedHall>();

            DownTo <RaggedCorridor>();

            SouthTo(() =>
            {
                var clam = Get <GiantClam>();

                if (Inventory.Contains(clam))
                {
                    if (clam.HasBeenOpened)
                    {
                        Print("You can't fit this five-foot oyster through that little passage!");
                    }
                    else
                    {
                        Print("You can't fit this five-foot clam through that little passage!");
                    }

                    return(this);
                }

                return(Rooms.Get <ComplexJunction>());
            });
        }
Example #26
0
        public override void Initialize()
        {
            Name = "At Slit In Streambed";
            Synonyms.Are("slit", "in", "streambed");
            Description = "At your feet all the water of the stream splashes into a 2-inch slit in the rock. Downstream the streambed is bare rock.";

            NorthTo <Valley>();
            EastTo <Forest1>();
            WestTo <Forest1>();
            SouthTo <OutsideGrate>();

            Before <Down>(() =>
            {
                Print("You don't fit through a two-inch slit!");
                return(true);
            });

            Before <In>(() =>
            {
                Print("You don't fit through a two-inch slit!");
                return(true);
            });

            Has <TwoInchSlit>();
            Has <Stream>();
        }
Example #27
0
        public override void Initialize()
        {
            Name = "ming vase";
            Synonyms.Are("vase", "ming", "delicate");
            Description = "It's a delicate, precious, ming vase!";

            DepositPoints = 14;

            After <Drop>(() =>
            {
                if (Location.Contains <VelvetPillow>())
                {
                    Print("(coming to rest, delicately, on the velvet pillow)");
                    return(false);
                }

                RepaceVaseWithShards();
                Print("The ming vase drops with a delicate crash.");
                return(true);
            });

            Before <Attack>(() =>
            {
                RepaceVaseWithShards();
                Print("You have taken the vase and hurled it delicately to the ground.");
                return(true);
            });

            Before <Receive>(() =>
            {
                Print("The vase is too fragile to use as a container.");
                return(true);
            });
        }
Example #28
0
        public async Task GetSynonyms()
        {
            using (WebClient client = new WebClient())
            {
                try
                {
                    GetHtmlHelper[3].PageContent = client.DownloadString($"{GetHtmlHelper[3].Uri}{GetHtmlHelper[3].VocText}");
                }
                catch (Exception)
                {
                }
            }

            Synonyms.Clear();
            while (GetHtmlHelper[3].PageContent != null && GetHtmlHelper[3].PageContent.Contains(GetHtmlHelper[3].Key))
            {
                GetHtmlHelper[3].Text = "";

                GetHtmlHelper[3].StartIndex = GetHtmlHelper[3].PageContent.IndexOf(GetHtmlHelper[3].Key) + GetHtmlHelper[3].Key.Length;
                GetHtmlHelper[3].Text       = GetHtmlHelper[3].PageContent.Substring(GetHtmlHelper[3].StartIndex);

                GetHtmlHelper[3].EndIndex = GetHtmlHelper[3].Text.IndexOf(GetHtmlHelper[3].KeyEnd);

                GetHtmlHelper[3].PageContent = GetHtmlHelper[3].Text;

                GetHtmlHelper[3].Text = GetHtmlHelper[3].Text.Substring(0, GetHtmlHelper[3].EndIndex);

                Synonyms.Add(GetHtmlHelper[3].Text.Trim());
            }
        }
 private void Load(IEnumerable <SynonymViewModel> synonyms)
 {
     foreach (var synonym in synonyms)
     {
         Synonyms.Add(synonym);
     }
 }
Example #30
0
        public override void Initialize()
        {
            Name = "pool of oil";
            Synonyms.Are("pool", "oil", "small");
            Description = "It looks like ordinary oil.";

            Before <Drink>(() =>
            {
                Print("Absolutely not.");
                return(true);
            });

            Before <Take>(() =>
            {
                if (!Player.Has <Bottle>())
                {
                    Print("You have nothing in which to carry the oil.");
                }
                else
                {
                    Execute("fill bottle");
                }
                return(true);
            });
        }