public Dictionary <int, logvis> setup(string str) { bidi bidi = new bidi(); string[] lines = str.Split(new[] { Environment.NewLine }, StringSplitOptions.None); // modified for awr int[] chars; Dictionary <int, logvis> str_ar = new Dictionary <int, logvis>(); foreach (string text in lines) { chars = bidi.Utf8Bidi(bidi.UTF8StringToArray(str), "AL"); if (bidi.ContainsArabicCharacter(str)) { Array.Reverse(chars); } int key = 0; foreach (int cha in chars) { logvis lg = new logvis(bidi.unichr(cha), bidi.unichr(cha)); str_ar.Add(key, lg); key++; } } return(str_ar); }
/** * [set_word_flag description] * set the flag for the charecters * @param [type] key1 [description] the position of the character in array / row * @param [type] key2 [description] the position of the character in array / column * @param [type] flag [description] rule flag name */ private void Set_word_flag(int key1, int key2, string flag) { text_ready[key1][key2] = new logvis(text_ready[key1][key2].chars, text_ready[key1][key2].word, flag); }