コード例 #1
0
 private static void AddLineBreakClassRange(Dictionary <int, UnicodeDataItem> codepoints, CodepointRange range,
                                            int lineBreakClass)
 {
     for (var i = range.Start; i <= range.End; i++)
     {
         if (!codepoints.ContainsKey(i))
         {
             codepoints.Add(i, new UnicodeDataItem {
                 Codepoint = i, LineBreakClass = lineBreakClass
             });
         }
         else
         {
             codepoints[i].LineBreakClass = lineBreakClass;
         }
     }
 }
コード例 #2
0
        private static void AddBiDiBracket(Dictionary <int, BiDiDataItem> codepoints, CodepointRange range,
                                           int bracketType)
        {
            if (!codepoints.ContainsKey(range.Start))
            {
                codepoints.Add(range.Start,
                               new BiDiDataItem {
                    Codepoint = range.Start, Bracket = range.End, BracketType = bracketType
                });
            }
            else
            {
                var codepoint = codepoints[range.Start];

                codepoint.Bracket     = range.End;
                codepoint.BracketType = bracketType;
            }
        }
コード例 #3
0
 private static void AddScriptRange(Dictionary <int, UnicodeDataItem> codepoints, CodepointRange range,
                                    int script)
 {
     for (var i = range.Start; i <= range.End; i++)
     {
         if (!codepoints.ContainsKey(i))
         {
             codepoints.Add(i, new UnicodeDataItem {
                 Codepoint = i, Script = script
             });
         }
         else
         {
             codepoints[i].Script = script;
         }
     }
 }
コード例 #4
0
 private static void AddBiDiClassRange(Dictionary <int, BiDiDataItem> codepoints, CodepointRange range,
                                       int biDiClass)
 {
     for (var i = range.Start; i <= range.End; i++)
     {
         if (!codepoints.ContainsKey(i))
         {
             codepoints.Add(i, new BiDiDataItem {
                 Codepoint = i, BiDiClass = biDiClass
             });
         }
         else
         {
             codepoints[i].BiDiClass = biDiClass;
         }
     }
 }
コード例 #5
0
 private static void AddGeneralCategoryRange(Dictionary <int, UnicodeDataItem> codepoints, CodepointRange range,
                                             int generalCategory)
 {
     for (var i = range.Start; i <= range.End; i++)
     {
         if (!codepoints.ContainsKey(i))
         {
             codepoints.Add(i, new UnicodeDataItem {
                 Codepoint = i, GeneralCategory = generalCategory
             });
         }
         else
         {
             codepoints[i].GeneralCategory = generalCategory;
         }
     }
 }