Example #1
0
        public void PutWord(string word, WordSize size)
        {
            var wordInformation = new WordInformation(word, size);
            var rectangle       = Cloud.PutNextRectangle(wordInformation.RectangleSize);

            WordToRectangle.Add(wordInformation, rectangle);
        }
Example #2
0
        public static string GetRandomWord(WordSize size)
        {
            string[] wordArray = null;

            switch (size)
            {
            case WordSize.Any:
                wordArray = AllWords;
                break;

            case WordSize.Short:
                wordArray = ShortWords;
                break;

            case WordSize.Medium:
                wordArray = MediumWords;
                break;

            case WordSize.Long:
                wordArray = LongWords;
                break;

            case WordSize.VeryLong:
                wordArray = VeryLongWords;
                break;

            default:
                break;
            }

            return(Utils.GetRandomFromList <string>(wordArray));
        }
Example #3
0
        public static string GetRandomSentences(WordSize size, int count)
        {
            var result = new StringBuilder();

            for (var i = 0; i < count; i++)
            {
                var sentence = GetRandomSentence(size);
                sentence = string.Concat(sentence.First().ToString().ToUpper(), sentence.Substring(1), ". ");
                result.Append(sentence.Trim());
                result.Append("\n\n");
            }

            return(result.ToString().Trim());
        }
        public static string GetRandomSentences(WordSize size, int count)
        {
            var result = new StringBuilder();

            for (var i = 0; i < count; i++)
            {
                var sentence = GetRandomSentence(size);
                sentence = string.Concat(sentence.First().ToString().ToUpper(), sentence.Substring(1), ". ");
                result.Append(sentence.Trim());
                result.Append("\n\n");
            }

            return result.ToString().Trim();
        }
        public static string GetRandomSentence(WordSize size)
        {
            if (size == WordSize.Short) return Fragments.GetRandomFragment();

            if (size == WordSize.Any)
            {
                var randomSize = Utils.GetRandomEnumValue<WordSize>();
                return GetRandomSentence(randomSize);
            }

            return string.Concat(
                GetRandomSentence(Paragraphs.GetLessEnumParagraph(size)),
                Words.GetPreposition(),
                GetRandomSentence(Paragraphs.GetLessEnumParagraph(size)));
        }
        public static WordSize GetLessEnumParagraph(WordSize size)
        {
            var newSize = WordSize.Short;

            switch (newSize)
            {
                case WordSize.Long:
                    newSize = WordSize.Medium;
                    break;
                case WordSize.VeryLong:
                    newSize = WordSize.Long;
                    break;
            }

            return newSize;
        }
Example #7
0
        public static WordSize GetLessEnumParagraph(WordSize size)
        {
            var newSize = WordSize.Short;

            switch (newSize)
            {
            case WordSize.Long:
                newSize = WordSize.Medium;
                break;

            case WordSize.VeryLong:
                newSize = WordSize.Long;
                break;
            }

            return(newSize);
        }
Example #8
0
        public static string GetRandomSentence(WordSize size)
        {
            if (size == WordSize.Short)
            {
                return(Fragments.GetRandomFragment());
            }

            if (size == WordSize.Any)
            {
                var randomSize = Utils.GetRandomEnumValue <WordSize>();
                return(GetRandomSentence(randomSize));
            }

            return(string.Concat(
                       GetRandomSentence(Paragraphs.GetLessEnumParagraph(size)),
                       Words.GetPreposition(),
                       GetRandomSentence(Paragraphs.GetLessEnumParagraph(size))));
        }
Example #9
0
 public WordInformation(string word, WordSize size)
 {
     Font          = new Font("Arial", fontSize[size]);
     Word          = word;
     RectangleSize = new Size((int)(word.Length * Font.Size), Font.Height);
 }
Example #10
0
        public static string GetRandomWord(WordSize size)
        {
            string[] wordArray = null;

            switch (size)
            {
                case WordSize.Any:
                    wordArray = AllWords;
                    break;
                case WordSize.Short:
                    wordArray = ShortWords;
                    break;
                case WordSize.Medium:
                    wordArray = MediumWords;
                    break;
                case WordSize.Long:
                    wordArray = LongWords;
                    break;
                case WordSize.VeryLong:
                    wordArray = VeryLongWords;
                    break;
                default:
                    break;
            }

            return Utils.GetRandomFromList<string>(wordArray);
        }
Example #11
0
 public WordType(WordSize size, WordSign sign)
 {
     Size = size;
     Sign = sign;
 }