private static CharRangeItem ReadCodeRangeFromFile(string path, Enums.UnicodeType unicodeType) { if (unicodeCharRanges == null) { unicodeCharRanges = ReadUnicodeCharRangesFromFile(path); } foreach (var unicodeRanges in unicodeCharRanges.Where(item => item.Type == unicodeType)) { return(new CharRangeItem { StartIndex = unicodeRanges.StartIndex, EndIndex = unicodeRanges.EndIndex, Type = unicodeRanges.Type }); } return(new CharRangeItem()); }
/// <summary> /// Get the range of Unicode character /// </summary> /// <param name="textType">Common Unicode types</param> /// <returns>The range in an array of 2 element: the first is the minimum character and the second is the maximum one. </returns> private static CharRangeItem GetUnicodeRange(Enums.UnicodeType textType) { //Based on: http://jrgraphix.net/r/Unicode/ return(ReadCodeRangeFromFile("TestData/unicode_chars_range.txt", textType)); }