Exemplo n.º 1
0
        public Phrase RandomPhrase()
        {
            var adjective = adjectives.RandomWord();
            var animal    = animals.RandomWord();

            return(Phrase.Create(adjective, animal));
        }
Exemplo n.º 2
0
        public Phrase PhraseStartingWith(string startWith)
        {
            var adjective = adjectives.WordStartingWith(startWith);
            var animal    = animals.WordStartingWith(startWith);

            return(Phrase.Create(adjective, animal));
        }
Exemplo n.º 3
0
        public Phrase AlliterativePhrase()
        {
            var adjective = adjectives.RandomWord();
            var animal    = animals.WordStartingWith(adjective.Substring(0, 1));

            return(Phrase.Create(adjective, animal));
        }
Exemplo n.º 4
0
 public void Setup()
 {
     helper = new WordsHandlerHelper();
     helper.RawTextExractor.Setup(item => item.GetWord("test")).Returns("T");
     helper.Handler.Setup(item => item.CheckSentiment(It.IsAny <WordOccurrence>())).Returns(new SentimentValue(new TestWordItem(string.Empty), "Text", 2));
     helper.Handler.Setup(item => item.IsStop(It.IsAny <WordOccurrence>())).Returns(false);
     helper.Handler.Setup(item => item.MeasureQuantifier(It.IsAny <WordOccurrence>())).Returns(2);
     instance = Phrase.Create(helper.Handler.Object, POSTags.Instance.NN);
 }
Exemplo n.º 5
0
        public void Create()
        {
            Assert.Throws <ArgumentNullException>(() => Phrase.Create(helper.Handler.Object, null));
            Assert.Throws <ArgumentNullException>(() => Phrase.Create(null, POSTags.Instance.NN));

            Assert.AreEqual(string.Empty, instance.Text);
            Assert.AreEqual(string.Empty, instance.Stemmed);
            Assert.AreEqual("NN", instance.POS.Tag);
            Assert.IsNotNull(instance.Relationship);
            Assert.IsFalse(instance.IsSentiment);
            Assert.IsFalse(instance.IsTopAttribute);
            Assert.IsNull(instance.QuantValue);
            Assert.IsFalse(instance.IsQuestion);
            Assert.IsFalse(instance.IsFeature);
            Assert.IsFalse(instance.IsFixed);
            Assert.IsFalse(instance.IsStopWord);
            Assert.IsFalse(instance.IsSimple);
            Assert.AreEqual(0, instance.AllWords.Count());
        }
Exemplo n.º 6
0
        private static WorldObject createDeco(XmlNode node, int x, int y)
        {
            WorldObject blueprint = worldObjects[XmlUtil.Get(node, "obj", "default")];

            return(new WorldObject()
            {
                X = Constants.TILE_SIZE * x,
                Y = Constants.TILE_SIZE * y,
                Trigger = XmlUtil.Get(node, "trigger", string.Empty),
                Rotation = XmlUtil.Get(node, "r", Direction.DOWN),
                Priority = XmlUtil.Get(node, "prio", 0),
                Conditions = XmlUtil.GetArray(node, "if", ' '),
                InverseConditions = XmlUtil.GetArray(node, "not", ' '),
                Id = XmlUtil.Get(node, "id", "object"),
                BlocksPath = blueprint.BlocksPath,
                Texture = blueprint.Texture,
                Name = blueprint.Name,
                Description = blueprint.Description,
                Event = new Event(Phrase.Create(blueprint.Description)),
            });
        }