public static void InitializeInterpretations() { HaifaDeafEntities km = new HaifaDeafEntities(); var interpretation = from k in km.interpretationn select k; Interpretations = new Dictionary <string, string[]>(); string[] Details; foreach (var c in interpretation) { Details = new string[2]; Details[0] = c.Description; Details[1] = c.Sign; Interpretations.Add(c.ID, Details); } }
public static void InitializeRules() { HaifaDeafEntities km = new HaifaDeafEntities(); var ML = from k in km.GrammarRules select k; GrammarRules = new List <string[]>(); string[] Rule; foreach (var c in ML) { Rule = new string[2]; Rule[0] = c.result; Rule[1] = c.expression; GrammarRules.Add(Rule); } }
public static void CheckForPronoun(ArabicWord WordToProcess, ref List <WordInfo> Possibilities) { WordInfo NewInfo; HaifaDeafEntities km = new HaifaDeafEntities(); var wproc = from k in km.ProperNouns where k.Word == WordToProcess.word select k; foreach (var c in wproc) { NewInfo = new WordInfo(); NewInfo.Meaning = c.Meaning; NewInfo.SpecialClass = "PN"; NewInfo.Word = WordToProcess.word; NewInfo.Diacritics = c.Diacritics; Possibilities.Add(NewInfo); } }
//List<WordAndItsReplacer> Replaced = new List<WordAndItsReplacer>(); private string Analyze() { string retVal = _Sentense; HaifaDeafEntities km = new HaifaDeafEntities(); /////قائمة الكلمات الثنائية المستبدلة //foreach (var c in toget) //{ // if (retVal.Contains(c)) // { // var rep = new WordAndItsReplacer() { WordID = c, WordReplacer = MainFunctions.GiveID() }; // Replaced.Add(rep); // retVal = retVal.Replace(c, rep.WordReplacer); // } //} // تقطيع الجمل حسب النقطة var Paragraphs = MainFunctions.Split(retVal, "."); string retSentense = ""; foreach (var P in Paragraphs) { string temp = P.Trim(); // الان هنا سيتم صياغة الجملة بمنظورها النهائي if (temp.Contains("!")) { temp = temp.Replace("!", ""); retSentense += "تعجب، "; } if (temp.Contains("?") || temp.Contains("؟")) { temp = temp.Replace("?", "").Replace("؟", ""); retSentense += "استفهام، "; } // إشارة | لكي أقوم بفصل المقدمة عن النهاية retSentense = retSentense + temp; } return(retSentense); }