private void PerformTranslation() { pr = new PostProcessor(RuleFileName, VerbListFileName, NounListFileName, AdjectiveListFileName, PronounListFileName, NounsCommonInBothLanguageFileName); pr.LoadTextToTranslate(currentlyTranslatingText); this.richTextBoxNepali.InnerText = pr.Translate(); if (HttpContext.Current != null && HttpContext.Current.Request != null && HttpContext.Current.Request.UrlReferrer != null) { log.referrer = HttpContext.Current.Request.UrlReferrer.ToString(); } else { log.referrer = ""; } log.date = DateTime.Now; log.input = currentlyTranslatingText; log.output = richTextBoxNepali.InnerText; if (HttpContext.Current != null && HttpContext.Current.Request != null && HttpContext.Current.Request.UserHostAddress != null) { log.ip = HttpContext.Current.Request.UserHostAddress.ToString(); } else { log.ip = ""; } AddLogs(); }
private void OpenInputFile(string inputFileName) { string tempString; string inputText = ""; StreamReader sr = new StreamReader(inputFileName); while ((tempString = sr.ReadLine()) != null) { inputText += (tempString + "\n"); } sr.Close(); this.richTextBoxHindi.InnerText = inputText; pr = new PostProcessor(RuleFileName, VerbListFileName, NounListFileName, AdjectiveListFileName, PronounListFileName, NounsCommonInBothLanguageFileName); pr.LoadTextToTranslate(inputText); this.richTextBoxNepali.InnerText = pr.Translate(); }
string GetTranslatedText(string inputstring) { pr = new PostProcessor(RuleFileName, VerbListFileName, NounListFileName, AdjectiveListFileName, PronounListFileName, NounsCommonInBothLanguageFileName); string returnString = (string.IsNullOrEmpty(inputstring) ? "" : inputstring); pr.LoadTextToTranslate(inputstring); returnString = pr.Translate(); if (referrerfield.Value != null) { log.referrer = referrerfield.Value; } else { log.referrer = ""; } log.input = inputstring; log.output = returnString; log.date = DateTime.Now; log.webservice = false; if (HttpContext.Current != null && HttpContext.Current.Request != null && HttpContext.Current.Request.UserHostAddress != null) { log.ip = HttpContext.Current.Request.UserHostAddress.ToString(); } else { log.ip = ""; } // AddLogs(); return(returnString); }