Exemple #1
0
        public void TestMethod_Tabulate_value_1()
        {
            const string expected = " ";
            string       result   = Punctuation.Tabulate();

            Assert.AreEqual(result, expected);
        }
        public void Add(Determinative subjectDeterminative, string subj, string verb, Determinative objectDeterminative, string obj,
                        Punctuation punctuation = Punctuation.Period, bool noInterrupt = false, bool requireMorePrompt = false)
        {
            sb.Append(Grammar.Get(subjectDeterminative, subj, verb));
            if (obj != null)
            {
                sb.Append(" ");
                sb.Append(Grammar.Get(objectDeterminative, obj));
            }
            if (punctuation == Punctuation.Period)
            {
                sb.Append(".");
            }
            else if (punctuation == Punctuation.ExclamationPoint)
            {
                sb.Append("!");
            }
            else if (punctuation == Punctuation.Ellipsis)
            {
                sb.Append("...");
            }
            else if (punctuation == Punctuation.QuestionMark)
            {
                sb.Append("?");
            }
            sb.Append(" ");
            string message = sb.ToString();

            sb.Clear();
            Add(message, noInterrupt, requireMorePrompt);
        }
Exemple #3
0
 public Sentence(string s)
 {
     Raw    = s;
     s      = s.Trim();
     Broken = s.RemovePunctuation().Split(' ');
     Length = Broken.Length;
     Words  = new Word[Broken.Length];
     if (s.EndsWith('!'))
     {
         EndingPunctuation = Punctuation.Exclamation;
     }
     else if (s.EndsWith('?'))
     {
         EndingPunctuation = Punctuation.Questinon;
     }
     else if (s.EndsWith('.'))
     {
         EndingPunctuation = Punctuation.Statement;
     }
     for (int i = 0; i < Broken.Length; i++)
     {
         Word w = new Word(Broken[i]);
         w.WordClassification = Broken[i].ComputeAbstraction();
         Words[i]             = w;
     }
 }
 public ISentenceViewModel Create(string sentence, Punctuation punctuation)
 {
     var sentenceVM = this._kernel.Get<ISentenceViewModel>();
       sentenceVM.Punctuation = punctuation;
       sentenceVM.BareSentence = sentence;
       return sentenceVM;
 }
        //todo, extra strings?
        public void Add(Determinative subjectDeterminative, Creature subj, string verb, Determinative objectDeterminative, Creature obj,
                        Punctuation punctuation   = Punctuation.Period, Visibility visibility = Visibility.RequireEither,
                        bool assumeSubjectVisible = false, bool assumeObjectVisible           = false, bool noInterrupt = false, bool requireMorePrompt = false)
        {
            bool subjectVisible = OmniscienceEnabled || assumeSubjectVisible || Player.CanSee(subj);
            bool objectVisible  = obj != null && (OmniscienceEnabled || assumeObjectVisible || Player.CanSee(obj));

            if (visibility == Visibility.RequireEither && !subjectVisible && !objectVisible)
            {
                return;
            }
            if (visibility == Visibility.RequireBoth && (!subjectVisible || !objectVisible))
            {
                return;
            }
            if (visibility == Visibility.RequireSubject && !subjectVisible)
            {
                return;
            }
            if (visibility == Visibility.RequireObject && !objectVisible)
            {
                return;
            }
            string subjectName = subjectVisible? Names.Get(subj.OriginalType) : "something";
            string objectName  = objectVisible? Names.Get(obj.OriginalType)
                                : (obj == null)? null : "something";

            Add(subjectDeterminative, subjectName, verb, objectDeterminative, objectName, punctuation, noInterrupt, requireMorePrompt);
        }
Exemple #6
0
        public void TestMethod_Tabulate_value_10()
        {
            const ushort source   = 10;
            const string expected = "          ";
            string       result   = Punctuation.Tabulate(source);

            Assert.AreEqual(result, expected);
        }
Exemple #7
0
        public void NextToken_ValidTwoCharPunctuation_ShourdReturnValidPunctuationToken(
            string code, Punctuation type)
        {
            var lexer = new VBScriptLexer(code);
            var token = Assert.IsType <PunctuationToken>(lexer.NextToken());

            Assert.Equal(type, token.Type);
        }
Exemple #8
0
        public static Text Parse(string fullText)
        {
            var numCurrentSymbol = 0;
            var numFirstSymbol   = 0;
            var sentence         = new Collection <ISentenceItem>();
            var text             = new Text();
            int numPunctuation   = 0;

            while (numCurrentSymbol <= fullText.Length - 1)
            {
                if (!char.IsLetterOrDigit(fullText[numCurrentSymbol]))
                {
                    if (char.IsWhiteSpace(fullText[numCurrentSymbol]))
                    {
                        if (numPunctuation < numCurrentSymbol)
                        {
                            sentence.Add(Word.GetWordByStringValue(fullText.Substring(numFirstSymbol, numCurrentSymbol - numFirstSymbol)));
                        }

                        numPunctuation = numCurrentSymbol + 1;
                        numFirstSymbol = numCurrentSymbol;
                        sentence.Add(Punctuation.GetPunctuationByStringValue(" "));
                    }
                    if (char.IsPunctuation(fullText[numCurrentSymbol]))
                    {
                        if (numPunctuation < numCurrentSymbol)
                        {
                            sentence.Add(Word.GetWordByStringValue(fullText.Substring(numFirstSymbol, numCurrentSymbol - numFirstSymbol)));
                        }
                        numPunctuation = numCurrentSymbol + 1;
                        numFirstSymbol = numCurrentSymbol;

                        while (numPunctuation <= fullText.Length - 1 && char.IsPunctuation(fullText[numPunctuation]))
                        {
                            numPunctuation++;
                            numCurrentSymbol++;
                        }
                        var punctuation = Punctuation.GetPunctuationByStringValue(fullText.Substring(numFirstSymbol, numPunctuation - numFirstSymbol));
                        if (punctuation != null)
                        {
                            sentence.Add(punctuation);
                            if (punctuation.IsEndSentence)
                            {
                                text.Add(new Sentence(sentence));
                                sentence = new Collection <ISentenceItem>();
                            }
                        }

                        numFirstSymbol = numCurrentSymbol + 1;
                    }
                    numFirstSymbol = numCurrentSymbol + 1;
                    numPunctuation = numCurrentSymbol + 1;
                }
                numCurrentSymbol++;
            }
            return(text);
        }
Exemple #9
0
        public static Text Parse(TextReader reader)
        {
            Text text = new Text();

            reader.Dispose();
            string line = reader.ReadLine();

            while (line != null)
            {
                while (string.IsNullOrWhiteSpace(line) == false)
                {
                    line = CleanLine(line);
                    Paragraph paragraph = new Paragraph();
                    Sentence  sentence  = new Sentence();

                    while (line.Length > 0)
                    {
                        int             firstSentenceSeparatorOccurence;
                        PunctuationMark firstSentenceSeparator;
                        SearchSeparator(line, out firstSentenceSeparatorOccurence, out firstSentenceSeparator);

                        if (firstSentenceSeparator.Equals(default(PunctuationMark)) == false)
                        {
                            if (firstSentenceSeparatorOccurence > 0)
                            {
                                Word word = new Word(line.Substring(0, firstSentenceSeparatorOccurence));
                                sentence.Items.Add(word);
                            }

                            Punctuation punctuation =
                                new Punctuation(line.Substring(firstSentenceSeparatorOccurence, firstSentenceSeparator.Value.Length),
                                                firstSentenceSeparator);

                            line = line.Remove(0, firstSentenceSeparatorOccurence + punctuation.Length);

                            sentence.Items.Add(punctuation);
                        }
                        else
                        {
                            Word word = new Word(line);
                            line = line.Remove(0, word.Length);
                            sentence.Items.Add(word);
                        }
                        if (firstSentenceSeparator.Equals(default(PunctuationMark)) == false &&
                            firstSentenceSeparator.Type == PunctuationMarkType.Terminal || line.Length == 0)
                        {
                            paragraph.Items.Add(sentence);
                            sentence = new Sentence();
                        }
                    }
                    text.Items.Add(paragraph);
                }
                line = reader.ReadLine();
            }
            return(text);
        }
Exemple #10
0
        /// <summary>
        /// Parses the sentence.
        /// </summary>
        /// <param name="content">The content.</param>
        /// <param name="paragraphObject">The paragraph object.</param>
        private void ParseSentence(string content, Paragraph paragraphObject)
        {
            if (!String.IsNullOrWhiteSpace(content))
            {
                Sentence        sentenceObject         = new Sentence();
                MatchCollection sentenceItemCollection = Regex.Matches(content, @"(\S+)", RegexOptions.Multiline);
                int             currentIndex           = 0;
                foreach (Match sentenceItemMatch in sentenceItemCollection)
                {
                    MatchCollection potentialWordCollection = Regex.Matches(sentenceItemMatch.Value, @"(\w*)(\W*)");
                    foreach (Match potentialWordItemMatch in potentialWordCollection)
                    {
                        Group  groupWord = potentialWordItemMatch.Groups[1];
                        string word      = groupWord.Value;

                        Group  groupOther  = potentialWordItemMatch.Groups[2];
                        string punctuation = groupOther.Value;

                        if (!String.IsNullOrEmpty(word))
                        {
                            ISentenceItem item = new Word(word);
                            sentenceObject.Add(item);
                        }

                        if (!String.IsNullOrEmpty(punctuation))
                        {
                            if (_PunctuationWithMultipleSymbols.Contains(punctuation))
                            {
                                ISentenceItem item = new Punctuation(punctuation);
                                sentenceObject.Add(item);
                            }
                            else
                            {
                                int i = 0;
                                foreach (char c in punctuation)
                                {
                                    ISentenceItem item = new Punctuation(c.ToString());
                                    sentenceObject.Add(item);
                                    i++;
                                }
                            }
                        }
                    }

                    currentIndex++;

                    if (currentIndex < sentenceItemCollection.Count)
                    {
                        sentenceObject.Add(new WhiteSpace(" "));
                    }
                }

                paragraphObject.Add(sentenceObject);
            }
        }
        public static char PunctuationToChar(this Punctuation punctuation)
        {
            var c = CharsByPunctuation.GetOrDefault(punctuation);

            if (c == default)
            {
                throw new ArgumentOutOfRangeException(nameof(c), $"'{punctuation}' is not a known punctuation.");
            }

            return(c);
        }
Exemple #12
0
        public Text SwapWordsOfSSelectedLengthWithSubstring(Text text, int index, int length, string substring)
        {
            List <SentenceItem> substr = new List <SentenceItem>();
            int  i = 0;
            char c;

            while (i < substring.Length)
            {
                c = substring[i];
                i++;
                if (c >= 'а' && c <= 'я' || c >= 'А' && c <= 'Я' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z')
                {
                    substr.Add(ReadWord(substring, ref i, ref c));
                }

                if (c != ' ')
                {
                    Punctuation punct = ReadPunctuation(substring, ref i, c);
                    substr.Add(punct);
                }
            }
            int j = 0;

            foreach (Article a in text.Articles)
            {
                foreach (Sentence s in a.Sentences)
                {
                    j++;
                    if (j == index)
                    {
                        for (i = 0; i < s.Items.Count; i++)
                        {
                            if (s.Items[i].IsWord())
                            {
                                Word word = s.Items[i] as Word;
                                if (word.Letters.Count == length)
                                {
                                    s.Items.Remove(s.Items[i]);
                                    foreach (SentenceItem si in substr)
                                    {
                                        s.Items.Insert(i, si);
                                        i++;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(text);
        }
Exemple #13
0
        public static void Init()
        {
            PunctuationsRepository pr             = new PunctuationsRepository();
            List <int>             punctuationIds = pr.PunctuationIDs().ToList();

            punctuation = pr.Punctuation(punctuationIds[new Random().Next(0, punctuationIds.Count())]);

            score = new Score
            {
                TestDate             = DateTime.Now,
                Category             = Category.PunctuationMarks,
                AmountOfRightAnswers = 0,
                AmountOfQuestions    = NbPunctuationMarks(punctuation.Text)
            };
        }
Exemple #14
0
 public static string GetPunctuation(Punctuation sp)
 {
     return(sp switch
     {
         Punctuation.NewLine => Environment.NewLine,
         Punctuation.Semicolon => ";",
         Punctuation.Comma => ",",
         Punctuation.Colon => ":",
         Punctuation.Space => " ",
         Punctuation.Tab => "\t",
         Punctuation.Dot => ".",
         Punctuation.Underline => "_",
         Punctuation.HorizontalBar => "-",
         Punctuation.Vertical => "|",
         _ => throw new ArgumentOutOfRangeException(nameof(sp), sp, null),
     });
Exemple #15
0
        public double[] GetParagraphVector(string text)
        {
            var words  = text.Split(Punctuation.ToArray(), StringSplitOptions.RemoveEmptyEntries).ToList();
            var vecSum = new double[getVectorSize(ModelIndex)];

            words = words.Except(StopWords).ToList();

            foreach (var word in words)
            {
                var vecWord = GetWordVector(word);
                vecSum = Add(vecSum, vecWord);
            }

            vecSum = Multiply(vecSum, 1.0 / words.Count());

            return(vecSum);
        }
Exemple #16
0
        public bool Apply(TransformableItem item)
        {
            var tokenGraph = (TokenGraph)item;

            bool fChanged = false;

            foreach (Vertex v in tokenGraph.Vertexes.Values)
            {
                if ((Token.IsPunctuation(v.Value) == false) && tokenGraph.IsTag(v))
                {
                    continue;
                }

                if (v.Token == null)
                {
                    fChanged = true;

                    Token tk = null;

                    if (Token.IsAlpha(v.Value))
                    {
                        tk = Word.New(v.Value);
                    }
                    else if (Token.IsNumeric(v.Value))
                    {
                        tk = Number.New(v.Value);
                    }
                    else if (Token.IsMathematicalSymbol(v.Value))
                    {
                        tk = MathematicalSymbol.New(v.Value);
                    }
                    else if (Token.IsPunctuation(v.Value))
                    {
                        tk = Punctuation.New(v.Value);
                    }
                    else
                    {
                        throw new ArgumentException($"Token {v.Value} could not be convered to a Token.");
                    }

                    v.Token = tk;
                }
            }

            return(fChanged);
        }
Exemple #17
0
        /// <summary>
        /// Translate English to Pig Latin method
        /// </summary>
        /// <remarks>
        /// This method will iterate through each word in the words array.
        /// If the word contains a special character or number
        ///     the word will remain untranslated.
        /// If the word starts with a vowel
        ///     the new word will be the same with a 'way' on the end.
        /// If the word starts with consonant
        ///     the new word will take the first sound and append it
        ///     with the addition of 'ay'.
        /// If the word was in upper case
        ///     the new word will remain in upper case.
        /// The new word will be added to the Pig Latin string separated by a space.
        /// </remarks>
        private void TranslateEnglishToPigLatin()
        {
            foreach (String word in words)
            {
                int    indexOfFirstVowel = 0;
                string endPunctuation    = Punctuation.GetEnd(word);
                string startPunctuation  = Punctuation.GetStart(word);
                newWord = word;

                if (!(HasSpecialChar(newWord) || HasNumber(newWord)))
                {
                    newWord           = Punctuation.RemoveStart(newWord);
                    newWord           = Punctuation.RemoveEnd(newWord);
                    indexOfFirstVowel = GetIndexOfFirstVowel(newWord);

                    if (IsVowel(word[0]))
                    {
                        newWord = newWord.Insert(newWord.Length, "way");
                    }
                    else if (checkStartsWithY(word))
                    {
                        indexOfFirstVowel += 1;
                        AppendAy(newWord, indexOfFirstVowel);
                    }
                    else
                    {
                        AppendAy(newWord, indexOfFirstVowel);
                    }

                    newWord = Punctuation.Insert(newWord, startPunctuation, endPunctuation);
                }
                else
                {
                    newWord = word;
                }

                if (IsUpperCase(word))
                {
                    newWord = newWord.ToUpper();
                }

                pigLatin += newWord + " ";
            }
        }
Exemple #18
0
        private static Punctuation ReadPunctuation(string substring, ref int i, char c)
        {
            Punctuation punctuation = new Punctuation();
            bool        flag        = true;

            punctuation.AddPunc(c);
            if (i != substring.Length)
            {
                do
                {
                    c = substring[i];
                    i++;
                    if (c == '.')
                    {
                        punctuation.AddPunc(c);
                    }
                    else
                    {
                        flag = false;
                    }
                } while (flag && i < substring.Length);
            }
            return(punctuation);
        }
Exemple #19
0
 /// <summary>
 /// 拼接
 /// </summary>
 /// <param name="str"></param>
 /// <param name="join"></param>
 /// <param name="sp">分隔符</param>
 /// <returns></returns>
 public static string Merge <TType, TYpe2>(this TType str, TYpe2 join, Punctuation sp)
 {
     return(str.ToString() + GetPunctuation(sp) + join.ToString());
 }
Exemple #20
0
 /// <summary>
 /// 拼接
 /// </summary>
 /// <param name="str"></param>
 /// <param name="join"></param>
 /// <param name="sp">分隔符</param>
 /// <returns></returns>
 public static string Merge(this string str, int join, Punctuation sp)
 {
     return(str + GetPunctuation(sp) + join.ToString());
 }
Exemple #21
0
 /// <summary>
 /// 拼接
 /// </summary>
 /// <param name="str"></param>
 /// <param name="join"></param>
 /// <param name="sp">分隔符</param>
 /// <returns></returns>
 public static string Merge(this int str, string join, Punctuation sp)
 {
     return(str.ToString() + GetPunctuation(sp) + join);
 }
Exemple #22
0
 public Sentence(List <ISentenceItem> items, Punctuation endPunctuation)
 {
     this.SentencePart = items ?? throw new ArgumentNullException(nameof(items));
     EndPunctuation    = endPunctuation ?? throw new ArgumentNullException(nameof(endPunctuation));
 }
Exemple #23
0
 /// <summary>
 /// 拼接
 /// </summary>
 /// <param name="str"></param>
 /// <param name="join"></param>
 /// <param name="sp">分隔符</param>
 /// <returns></returns>
 public static string Merge(this string str, string join, Punctuation sp)
 {
     return(str + GetPunctuation(sp) + join);
 }
Exemple #24
0
        private string FileNameFixer(string name)
        {
            const string Punctuation = "* <>$#;,./&%?!'^+&()=";
            string       fixedName   = "";

            foreach (char c in name)
            {
                if (Punctuation.Contains(c))
                {
                    fixedName += "_";
                }
                else if (c.Equals('Ö'))
                {
                    fixedName += "O";
                }
                else if (c.Equals('ö'))
                {
                    fixedName += "o";
                }
                else if (c.Equals('Ç'))
                {
                    fixedName += "C";
                }
                else if (c.Equals('ç'))
                {
                    fixedName += "c";
                }
                else if (c.Equals('Ş'))
                {
                    fixedName += "S";
                }
                else if (c.Equals('ş'))
                {
                    fixedName += "s";
                }
                else if (c.Equals('Ğ'))
                {
                    fixedName += "G";
                }
                else if (c.Equals('ğ'))
                {
                    fixedName += "g";
                }
                else if (c.Equals('Ü'))
                {
                    fixedName += "U";
                }
                else if (c.Equals('ü'))
                {
                    fixedName += "u";
                }
                else if (c.Equals('İ') || c.Equals('ı'))
                {
                    fixedName += "i";
                }
                else
                {
                    fixedName += c;
                }
            }
            progressBar1.Value = 40;
            return(fixedName);
        }
Exemple #25
0
 public void TestPositiveCategories()
 {
     Assert.AreEqual(UppercaseLetter.ToString(), UnicodeCategory(Categories.UppercaseLetter).ToString());
     Assert.AreEqual(LowercaseLetter.ToString(), UnicodeCategory(Categories.LowercaseLetter).ToString());
     Assert.AreEqual(TitlecaseLetter.ToString(), UnicodeCategory(Categories.TitlecaseLetter).ToString());
     Assert.AreEqual(ModifierLetter.ToString(), UnicodeCategory(Categories.ModifierLetter).ToString());
     Assert.AreEqual(OtherLetter.ToString(), UnicodeCategory(Categories.OtherLetter).ToString());
     Assert.AreEqual(Letter.ToString(), UnicodeCategory(Categories.Letter).ToString());
     Assert.AreEqual(NonspacingMark.ToString(), UnicodeCategory(Categories.NonspacingMark).ToString());
     Assert.AreEqual(SpacingCombiningMark.ToString(), UnicodeCategory(Categories.SpacingCombiningMark).ToString());
     Assert.AreEqual(EnclosingMark.ToString(), UnicodeCategory(Categories.EnclosingMark).ToString());
     Assert.AreEqual(Mark.ToString(), UnicodeCategory(Categories.Mark).ToString());
     Assert.AreEqual(DecimalDigitNumber.ToString(), UnicodeCategory(Categories.DecimalDigitNumber).ToString());
     Assert.AreEqual(LetterNumber.ToString(), UnicodeCategory(Categories.LetterNumber).ToString());
     Assert.AreEqual(OtherNumber.ToString(), UnicodeCategory(Categories.OtherNumber).ToString());
     Assert.AreEqual(Number.ToString(), UnicodeCategory(Categories.Number).ToString());
     Assert.AreEqual(ConnectorPunctuation.ToString(), UnicodeCategory(Categories.ConnectorPunctuation).ToString());
     Assert.AreEqual(DashPunctuation.ToString(), UnicodeCategory(Categories.DashPunctuation).ToString());
     Assert.AreEqual(OpenPunctuation.ToString(), UnicodeCategory(Categories.OpenPunctuation).ToString());
     Assert.AreEqual(ClosePunctuation.ToString(), UnicodeCategory(Categories.ClosePunctuation).ToString());
     Assert.AreEqual(InitialquotePunctuation.ToString(), UnicodeCategory(Categories.InitialquotePunctuation).ToString());
     Assert.AreEqual(FinalquotePunctuation.ToString(), UnicodeCategory(Categories.FinalquotePunctuation).ToString());
     Assert.AreEqual(OtherPunctuation.ToString(), UnicodeCategory(Categories.OtherPunctuation).ToString());
     Assert.AreEqual(Punctuation.ToString(), UnicodeCategory(Categories.Punctuation).ToString());
     Assert.AreEqual(MathSymbol.ToString(), UnicodeCategory(Categories.MathSymbol).ToString());
     Assert.AreEqual(CurrencySymbol.ToString(), UnicodeCategory(Categories.CurrencySymbol).ToString());
     Assert.AreEqual(ModifierSymbol.ToString(), UnicodeCategory(Categories.ModifierSymbol).ToString());
     Assert.AreEqual(OtherSymbol.ToString(), UnicodeCategory(Categories.OtherSymbol).ToString());
     Assert.AreEqual(Patterns.Unicode.Symbol.ToString(), UnicodeCategory(Categories.Symbol).ToString());
     Assert.AreEqual(SpaceSeparator.ToString(), UnicodeCategory(Categories.SpaceSeparator).ToString());
     Assert.AreEqual(LineSeparator.ToString(), UnicodeCategory(Categories.LineSeparator).ToString());
     Assert.AreEqual(ParagraphSeparator.ToString(), UnicodeCategory(Categories.ParagraphSeparator).ToString());
     Assert.AreEqual(Separator.ToString(), UnicodeCategory(Categories.Separator).ToString());
     Assert.AreEqual(Format.ToString(), UnicodeCategory(Categories.Format).ToString());
     Assert.AreEqual(Surrogate.ToString(), UnicodeCategory(Categories.Surrogate).ToString());
     Assert.AreEqual(PrivateUse.ToString(), UnicodeCategory(Categories.PrivateUse).ToString());
     Assert.AreEqual(NotAssigned.ToString(), UnicodeCategory(Categories.NotAssigned).ToString());
     Assert.AreEqual(OtherControl.ToString(), UnicodeCategory(Categories.OtherControl).ToString());
     Assert.AreEqual(Control.ToString(), UnicodeCategory(Categories.Control).ToString());
     Assert.AreEqual(BasicLatin.ToString(), UnicodeCategory(Categories.BasicLatin).ToString());
     Assert.AreEqual(Latin_1Supplement.ToString(), UnicodeCategory(Categories.Latin_1Supplement).ToString());
     Assert.AreEqual(LatinExtended_A.ToString(), UnicodeCategory(Categories.LatinExtended_A).ToString());
     Assert.AreEqual(LatinExtended_B.ToString(), UnicodeCategory(Categories.LatinExtended_B).ToString());
     Assert.AreEqual(IPAExtensions.ToString(), UnicodeCategory(Categories.IPAExtensions).ToString());
     Assert.AreEqual(SpacingModifierLetters.ToString(), UnicodeCategory(Categories.SpacingModifierLetters).ToString());
     Assert.AreEqual(CombiningDiacriticalMarks.ToString(), UnicodeCategory(Categories.CombiningDiacriticalMarks).ToString());
     Assert.AreEqual(Greek.ToString(), UnicodeCategory(Categories.Greek).ToString());
     Assert.AreEqual(GreekandCoptic.ToString(), UnicodeCategory(Categories.GreekandCoptic).ToString());
     Assert.AreEqual(Cyrillic.ToString(), UnicodeCategory(Categories.Cyrillic).ToString());
     Assert.AreEqual(CyrillicSupplement.ToString(), UnicodeCategory(Categories.CyrillicSupplement).ToString());
     Assert.AreEqual(Armenian.ToString(), UnicodeCategory(Categories.Armenian).ToString());
     Assert.AreEqual(Hebrew.ToString(), UnicodeCategory(Categories.Hebrew).ToString());
     Assert.AreEqual(Arabic.ToString(), UnicodeCategory(Categories.Arabic).ToString());
     Assert.AreEqual(Syriac.ToString(), UnicodeCategory(Categories.Syriac).ToString());
     Assert.AreEqual(Thaana.ToString(), UnicodeCategory(Categories.Thaana).ToString());
     Assert.AreEqual(Devanagari.ToString(), UnicodeCategory(Categories.Devanagari).ToString());
     Assert.AreEqual(Bengali.ToString(), UnicodeCategory(Categories.Bengali).ToString());
     Assert.AreEqual(Gurmukhi.ToString(), UnicodeCategory(Categories.Gurmukhi).ToString());
     Assert.AreEqual(Gujarati.ToString(), UnicodeCategory(Categories.Gujarati).ToString());
     Assert.AreEqual(Oriya.ToString(), UnicodeCategory(Categories.Oriya).ToString());
     Assert.AreEqual(Tamil.ToString(), UnicodeCategory(Categories.Tamil).ToString());
     Assert.AreEqual(Telugu.ToString(), UnicodeCategory(Categories.Telugu).ToString());
     Assert.AreEqual(Kannada.ToString(), UnicodeCategory(Categories.Kannada).ToString());
     Assert.AreEqual(Malayalam.ToString(), UnicodeCategory(Categories.Malayalam).ToString());
     Assert.AreEqual(Sinhala.ToString(), UnicodeCategory(Categories.Sinhala).ToString());
     Assert.AreEqual(Thai.ToString(), UnicodeCategory(Categories.Thai).ToString());
     Assert.AreEqual(Lao.ToString(), UnicodeCategory(Categories.Lao).ToString());
     Assert.AreEqual(Tibetan.ToString(), UnicodeCategory(Categories.Tibetan).ToString());
     Assert.AreEqual(Myanmar.ToString(), UnicodeCategory(Categories.Myanmar).ToString());
     Assert.AreEqual(Georgian.ToString(), UnicodeCategory(Categories.Georgian).ToString());
     Assert.AreEqual(HangulJamo.ToString(), UnicodeCategory(Categories.HangulJamo).ToString());
     Assert.AreEqual(Ethiopic.ToString(), UnicodeCategory(Categories.Ethiopic).ToString());
     Assert.AreEqual(Cherokee.ToString(), UnicodeCategory(Categories.Cherokee).ToString());
     Assert.AreEqual(UnifiedCanadianAboriginalSyllabics.ToString(), UnicodeCategory(Categories.UnifiedCanadianAboriginalSyllabics).ToString());
     Assert.AreEqual(Ogham.ToString(), UnicodeCategory(Categories.Ogham).ToString());
     Assert.AreEqual(Runic.ToString(), UnicodeCategory(Categories.Runic).ToString());
     Assert.AreEqual(Tagalog.ToString(), UnicodeCategory(Categories.Tagalog).ToString());
     Assert.AreEqual(Hanunoo.ToString(), UnicodeCategory(Categories.Hanunoo).ToString());
     Assert.AreEqual(Buhid.ToString(), UnicodeCategory(Categories.Buhid).ToString());
     Assert.AreEqual(Tagbanwa.ToString(), UnicodeCategory(Categories.Tagbanwa).ToString());
     Assert.AreEqual(Khmer.ToString(), UnicodeCategory(Categories.Khmer).ToString());
     Assert.AreEqual(Mongolian.ToString(), UnicodeCategory(Categories.Mongolian).ToString());
     Assert.AreEqual(Limbu.ToString(), UnicodeCategory(Categories.Limbu).ToString());
     Assert.AreEqual(TaiLe.ToString(), UnicodeCategory(Categories.TaiLe).ToString());
     Assert.AreEqual(KhmerSymbols.ToString(), UnicodeCategory(Categories.KhmerSymbols).ToString());
     Assert.AreEqual(PhoneticExtensions.ToString(), UnicodeCategory(Categories.PhoneticExtensions).ToString());
     Assert.AreEqual(LatinExtendedAdditional.ToString(), UnicodeCategory(Categories.LatinExtendedAdditional).ToString());
     Assert.AreEqual(GreekExtended.ToString(), UnicodeCategory(Categories.GreekExtended).ToString());
     Assert.AreEqual(GeneralPunctuation.ToString(), UnicodeCategory(Categories.GeneralPunctuation).ToString());
     Assert.AreEqual(SuperscriptsandSubscripts.ToString(), UnicodeCategory(Categories.SuperscriptsandSubscripts).ToString());
     Assert.AreEqual(CurrencySymbols.ToString(), UnicodeCategory(Categories.CurrencySymbols).ToString());
     Assert.AreEqual(CombiningDiacriticalMarksforSymbols.ToString(), UnicodeCategory(Categories.CombiningDiacriticalMarksforSymbols).ToString());
     Assert.AreEqual(CombiningMarksforSymbols.ToString(), UnicodeCategory(Categories.CombiningMarksforSymbols).ToString());
     Assert.AreEqual(LetterlikeSymbols.ToString(), UnicodeCategory(Categories.LetterlikeSymbols).ToString());
     Assert.AreEqual(NumberForms.ToString(), UnicodeCategory(Categories.NumberForms).ToString());
     Assert.AreEqual(Arrows.ToString(), UnicodeCategory(Categories.Arrows).ToString());
     Assert.AreEqual(MathematicalOperators.ToString(), UnicodeCategory(Categories.MathematicalOperators).ToString());
     Assert.AreEqual(MiscellaneousTechnical.ToString(), UnicodeCategory(Categories.MiscellaneousTechnical).ToString());
     Assert.AreEqual(ControlPictures.ToString(), UnicodeCategory(Categories.ControlPictures).ToString());
     Assert.AreEqual(OpticalCharacterRecognition.ToString(), UnicodeCategory(Categories.OpticalCharacterRecognition).ToString());
     Assert.AreEqual(EnclosedAlphanumerics.ToString(), UnicodeCategory(Categories.EnclosedAlphanumerics).ToString());
     Assert.AreEqual(BoxDrawing.ToString(), UnicodeCategory(Categories.BoxDrawing).ToString());
     Assert.AreEqual(BlockElements.ToString(), UnicodeCategory(Categories.BlockElements).ToString());
     Assert.AreEqual(GeometricShapes.ToString(), UnicodeCategory(Categories.GeometricShapes).ToString());
     Assert.AreEqual(MiscellaneousSymbols.ToString(), UnicodeCategory(Categories.MiscellaneousSymbols).ToString());
     Assert.AreEqual(Dingbats.ToString(), UnicodeCategory(Categories.Dingbats).ToString());
     Assert.AreEqual(MiscellaneousMathematicalSymbols_A.ToString(), UnicodeCategory(Categories.MiscellaneousMathematicalSymbols_A).ToString());
     Assert.AreEqual(SupplementalArrows_A.ToString(), UnicodeCategory(Categories.SupplementalArrows_A).ToString());
     Assert.AreEqual(BraillePatterns.ToString(), UnicodeCategory(Categories.BraillePatterns).ToString());
     Assert.AreEqual(SupplementalArrows_B.ToString(), UnicodeCategory(Categories.SupplementalArrows_B).ToString());
     Assert.AreEqual(MiscellaneousMathematicalSymbols_B.ToString(), UnicodeCategory(Categories.MiscellaneousMathematicalSymbols_B).ToString());
     Assert.AreEqual(SupplementalMathematicalOperators.ToString(), UnicodeCategory(Categories.SupplementalMathematicalOperators).ToString());
     Assert.AreEqual(MiscellaneousSymbolsandArrows.ToString(), UnicodeCategory(Categories.MiscellaneousSymbolsandArrows).ToString());
     Assert.AreEqual(CJKRadicalsSupplement.ToString(), UnicodeCategory(Categories.CJKRadicalsSupplement).ToString());
     Assert.AreEqual(KangxiRadicals.ToString(), UnicodeCategory(Categories.KangxiRadicals).ToString());
     Assert.AreEqual(IdeographicDescriptionCharacters.ToString(), UnicodeCategory(Categories.IdeographicDescriptionCharacters).ToString());
     Assert.AreEqual(CJKSymbolsandPunctuation.ToString(), UnicodeCategory(Categories.CJKSymbolsandPunctuation).ToString());
     Assert.AreEqual(Hiragana.ToString(), UnicodeCategory(Categories.Hiragana).ToString());
     Assert.AreEqual(Katakana.ToString(), UnicodeCategory(Categories.Katakana).ToString());
     Assert.AreEqual(Bopomofo.ToString(), UnicodeCategory(Categories.Bopomofo).ToString());
     Assert.AreEqual(HangulCompatibilityJamo.ToString(), UnicodeCategory(Categories.HangulCompatibilityJamo).ToString());
     Assert.AreEqual(Kanbun.ToString(), UnicodeCategory(Categories.Kanbun).ToString());
     Assert.AreEqual(BopomofoExtended.ToString(), UnicodeCategory(Categories.BopomofoExtended).ToString());
     Assert.AreEqual(KatakanaPhoneticExtensions.ToString(), UnicodeCategory(Categories.KatakanaPhoneticExtensions).ToString());
     Assert.AreEqual(EnclosedCJKLettersandMonths.ToString(), UnicodeCategory(Categories.EnclosedCJKLettersandMonths).ToString());
     Assert.AreEqual(CJKCompatibility.ToString(), UnicodeCategory(Categories.CJKCompatibility).ToString());
     Assert.AreEqual(CJKUnifiedIdeographsExtensionA.ToString(), UnicodeCategory(Categories.CJKUnifiedIdeographsExtensionA).ToString());
     Assert.AreEqual(YijingHexagramSymbols.ToString(), UnicodeCategory(Categories.YijingHexagramSymbols).ToString());
     Assert.AreEqual(CJKUnifiedIdeographs.ToString(), UnicodeCategory(Categories.CJKUnifiedIdeographs).ToString());
     Assert.AreEqual(YiSyllables.ToString(), UnicodeCategory(Categories.YiSyllables).ToString());
     Assert.AreEqual(YiRadicals.ToString(), UnicodeCategory(Categories.YiRadicals).ToString());
     Assert.AreEqual(HangulSyllables.ToString(), UnicodeCategory(Categories.HangulSyllables).ToString());
     Assert.AreEqual(HighSurrogates.ToString(), UnicodeCategory(Categories.HighSurrogates).ToString());
     Assert.AreEqual(HighPrivateUseSurrogates.ToString(), UnicodeCategory(Categories.HighPrivateUseSurrogates).ToString());
     Assert.AreEqual(LowSurrogates.ToString(), UnicodeCategory(Categories.LowSurrogates).ToString());
     Assert.AreEqual(PrivateUseArea.ToString(), UnicodeCategory(Categories.PrivateUseArea).ToString());
     Assert.AreEqual(CJKCompatibilityIdeographs.ToString(), UnicodeCategory(Categories.CJKCompatibilityIdeographs).ToString());
     Assert.AreEqual(LettericPresentationForms.ToString(), UnicodeCategory(Categories.LettericPresentationForms).ToString());
     Assert.AreEqual(ArabicPresentationForms_A.ToString(), UnicodeCategory(Categories.ArabicPresentationForms_A).ToString());
     Assert.AreEqual(VariationSelectors.ToString(), UnicodeCategory(Categories.VariationSelectors).ToString());
     Assert.AreEqual(CombiningHalfMarks.ToString(), UnicodeCategory(Categories.CombiningHalfMarks).ToString());
     Assert.AreEqual(CJKCompatibilityForms.ToString(), UnicodeCategory(Categories.CJKCompatibilityForms).ToString());
     Assert.AreEqual(SmallFormVariants.ToString(), UnicodeCategory(Categories.SmallFormVariants).ToString());
     Assert.AreEqual(ArabicPresentationForms_B.ToString(), UnicodeCategory(Categories.ArabicPresentationForms_B).ToString());
     Assert.AreEqual(HalfwidthandFullwidthForms.ToString(), UnicodeCategory(Categories.HalfwidthandFullwidthForms).ToString());
     Assert.AreEqual(Specials.ToString(), UnicodeCategory(Categories.Specials).ToString());
 }
Exemple #26
0
 /// <summary>
 /// 拼接
 /// </summary>
 /// <param name="str"></param>
 /// <param name="sp"></param>
 /// <returns></returns>
 public static string Merge(this IEnumerable <string> str, Punctuation sp)
 {
     return(string.Join(GetPunctuation(sp), str));
 }
Exemple #27
0
 /// <summary>
 /// 拼接
 /// </summary>
 /// <param name="str"></param>
 /// <param name="sp">分隔符</param>
 /// <returns></returns>
 public static string Merge(this string str, Punctuation sp)
 {
     return(str + GetPunctuation(sp));
 }
 public void AddSimple(Creature subj, string verb,
                       Punctuation punctuation   = Punctuation.Period, Visibility visibility = Visibility.RequireSubject,
                       bool assumeSubjectVisible = false, bool assumeObjectVisible           = false, bool noInterrupt = false, bool requireMorePrompt = false)
 => Add(Determinative.The, subj, verb, Determinative.None, null, punctuation, visibility,
        assumeSubjectVisible, false, noInterrupt, requireMorePrompt);
Exemple #29
0
        private static void NewPunctuation(string symbol, ISentence sentence)
        {
            var punctuation = new Punctuation(symbol.ToString());

            sentence.Items.Add(punctuation);
        }
Exemple #30
0
 internal string GetPunctuation()
 {
     return(Punctuation.ToString());
 }