public VerbInflection(Verb vrb, ZamirPeyvastehType zamir, string zamirPeyvastehString, ShakhsType shakhstype, TenseFormationType tenseFormationType, TensePositivity positivity, TensePassivity passivity) { VerbStem = vrb; ZamirPeyvasteh = zamir; ZamirPeyvastehString = zamirPeyvastehString; Shakhs = shakhstype; TenseForm = tenseFormationType; Positivity = positivity; Passivity = passivity; }
public VerbInflection(Verb vrb, AttachedPronounType zamir,string zamirPeyvastehString, PersonType shakhstype,TenseFormationType tenseFormationType,TensePositivity positivity, TensePassivity passivity) { VerbRoot = vrb; ZamirPeyvasteh = zamir; AttachedPronounString = zamirPeyvastehString; Person = shakhstype; TenseForm = tenseFormationType; Positivity = positivity; Passivity = passivity; }
/// <summary> /// Get the verb tokens with their corresponding details /// </summary> /// <param name="sentence">array of words in the sentence</param> /// <param name="posTokens">array of POS tags in the sentence</param> /// <param name="newPosTokens">to be converted: new array of POS tags in the sentence</param> /// <param name="lemmas">array of lemmas in the sentence</param> /// <param name="outLemmas">to be converted: new array of lemmas in the sentence</param> /// <param name="verbDicPath">path of dictionary file</param> /// <returns></returns> public static Dictionary<int, KeyValuePair<string, VerbInflection>> GetVerbTokens(string[] sentence, string[] posTokens, out string[] newPosTokens, string[] lemmas, out string[] outLemmas) { var outputResults = new Dictionary<int, KeyValuePair<string, VerbInflection>>(); var output = GetOutputResult(sentence, posTokens, out newPosTokens, lemmas, out outLemmas); for (int i = 0; i < output.Count; i++) { var values = output[i]; VerbInflection inflection; TensePassivity passivity; TensePositivity positivity; Verb verb; PersonType shakhsType; TenseFormationType tenseFormationType; AttachedPronounType zamirPeyvastehType; string zamirString; List<VerbInflection> tempInfleclist; VerbInflection tempInflec; string[] tokens = output[i].Key.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); switch (values.Value) { #region 10 case 10: tenseFormationType = TenseFormationType.HAAL_SAADEH_EKHBARI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_SAADEH_EKHBARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; zamirString = tempInflec.AttachedPronounString; shakhsType = tempInflec.Person; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 53 case 53: tenseFormationType = TenseFormationType.HAAL_SAADEH; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_SAADEH && (inflectionIter.VerbRoot.PastTenseRoot == "بایست" || inflectionIter.VerbRoot.PresentTenseRoot == "توان")) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; zamirString = tempInflec.AttachedPronounString; shakhsType = tempInflec.Person; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 14 case 14: tenseFormationType = TenseFormationType.HAAL_ELTEZAMI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_ELTEZAMI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; zamirString = tempInflec.AttachedPronounString; shakhsType = tempInflec.Person; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 15 case 15: tenseFormationType = TenseFormationType.AMR; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.AMR) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirString = tempInflec.AttachedPronounString; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; shakhsType = tempInflec.Person; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 17 case 17: tenseFormationType = TenseFormationType.GOZASHTEH_SADEH; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_SADEH) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; zamirString = tempInflec.AttachedPronounString; shakhsType = tempInflec.Person; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 18 case 18: tenseFormationType = TenseFormationType.GOZASHTEH_ESTEMRAARI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_ESTEMRAARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; zamirString = tempInflec.AttachedPronounString; shakhsType = tempInflec.Person; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 20 case 20: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_SADEH) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; shakhsType = tempInflec.Person; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 21 case 21: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; shakhsType = tempInflec.Person; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 11 case 11: tenseFormationType = TenseFormationType.HAAL_SAADEH_EKHBARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_SAADEH_EKHBARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); verb.PastTenseRoot = "کرد"; verb.PresentTenseRoot = "کن"; shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 16 case 16: tenseFormationType = TenseFormationType.AMR; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.AMR) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); verb.PastTenseRoot = "کرد"; verb.PresentTenseRoot = "کن"; shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 12 case 12: tenseFormationType = TenseFormationType.HAAL_ELTEZAMI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_ELTEZAMI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); verb.PastTenseRoot = "کرد"; verb.PresentTenseRoot = "کن"; shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 13 case 13: tenseFormationType = TenseFormationType.GOZASHTEH_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_SADEH) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); verb.PastTenseRoot = "کرد"; verb.PresentTenseRoot = "کن"; shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 19 case 19: tenseFormationType = TenseFormationType.GOZASHTEH_ESTEMRAARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_ESTEMRAARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); verb.PastTenseRoot = "کرد"; verb.PresentTenseRoot = "کن"; shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 22 case 22: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_SADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 23 case 23: tenseFormationType = TenseFormationType.GOZASHTEH_ESTEMRAARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_ESTEMRAARI) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 24 case 24: tenseFormationType = TenseFormationType.HAAL_SAADEH_EKHBARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_SAADEH_EKHBARI) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 25 case 25: tenseFormationType = TenseFormationType.HAAL_ELTEZAMI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_ELTEZAMI) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 26 case 26: tenseFormationType = TenseFormationType.GOZASHTEH_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_SADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 27 case 27: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); shakhsType = PersonType.THIRD_PERSON_SINGULAR; if (tokens.Length == 2) { if (tokens[1] == "نیست") { positivity = TensePositivity.NEGATIVE; } else { positivity = TensePositivity.POSITIVE; } } else { positivity = TensePositivity.POSITIVE; } zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 28 case 28: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 29 case 29: tenseFormationType = TenseFormationType.GOZASHTEH_BAEED; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_SADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 30 case 30: tenseFormationType = TenseFormationType.GOZASHTEH_ELTEZAMI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_ELTEZAMI) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 31 case 31: tenseFormationType = TenseFormationType.AAYANDEH; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_SAADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; tempInfleclist = VerbList.VerbShapes[tokens[1]]; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; verb = new Verb("", tempInflec.VerbRoot.PastTenseRoot, tempInflec.VerbRoot.PresentTenseRoot, tempInflec.VerbRoot.Prefix, "", VerbTransitivity.Transitive, tempInflec.VerbRoot.Type, true, tempInflec.VerbRoot.PresentRootConsonantVowelEndStem, tempInflec.VerbRoot.PastRootVowelStart, tempInflec.VerbRoot.PresentRootVowelStart); tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.IsPayehFelMasdari() && inflectionIter.Positivity==TensePositivity.POSITIVE) { tempInflec = inflectionIter; break; } } verb.PastTenseRoot = tempInflec.VerbRoot.PastTenseRoot; verb.PresentTenseRoot = tempInflec.VerbRoot.PresentTenseRoot; verb.Transitivity = tempInflec.VerbRoot.Transitivity; verb.CanBeImperative = tempInflec.VerbRoot.CanBeImperative; verb.PresentRootConsonantVowelEndStem = tempInflec.VerbRoot.PresentRootConsonantVowelEndStem; verb.PastRootVowelStart = tempInflec.VerbRoot.PastRootVowelStart; verb.PresentRootVowelStart = tempInflec.VerbRoot.PresentRootVowelStart; if (zamirPeyvastehType == AttachedPronounType.AttachedPronoun_NONE) zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 32 case 32: tenseFormationType = TenseFormationType.AAYANDEH; passivity = TensePassivity.PASSIVE; //ToCheck tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_SAADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; tempInfleclist = VerbList.VerbShapes[tokens[1]]; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; verb = new Verb("", tempInflec.VerbRoot.PastTenseRoot, tempInflec.VerbRoot.PresentTenseRoot, tempInflec.VerbRoot.Prefix, "", VerbTransitivity.Transitive, tempInflec.VerbRoot.Type, true, tempInflec.VerbRoot.PresentRootConsonantVowelEndStem, tempInflec.VerbRoot.PastRootVowelStart, tempInflec.VerbRoot.PresentRootVowelStart); tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.IsPayehFelMasdari()) { tempInflec = inflectionIter; break; } } verb.PastTenseRoot = "کرد"; verb.PresentTenseRoot = "کن"; verb.Transitivity = VerbTransitivity.Transitive; verb.CanBeImperative = tempInflec.VerbRoot.CanBeImperative; verb.PresentRootConsonantVowelEndStem = tempInflec.VerbRoot.PresentRootConsonantVowelEndStem; verb.PastRootVowelStart = tempInflec.VerbRoot.PastRootVowelStart; verb.PresentRootVowelStart = tempInflec.VerbRoot.PresentRootVowelStart; if (zamirPeyvastehType == AttachedPronounType.AttachedPronoun_NONE) zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 34 case 34: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; shakhsType = PersonType.THIRD_PERSON_SINGULAR; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 38,39 case 38: case 39: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; shakhsType = PersonType.THIRD_PERSON_SINGULAR; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 41 case 41: tenseFormationType = TenseFormationType.GOZASHTEH_BAEED; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; positivity = tempInflec.Positivity; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_SADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 42 case 42: tenseFormationType = TenseFormationType.GOZASHTEH_ELTEZAMI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; positivity = tempInflec.Positivity; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_ELTEZAMI) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 33 case 33: tenseFormationType = TenseFormationType.AAYANDEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_ELTEZAMI) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; tempInfleclist = VerbList.VerbShapes[tokens[2]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_ELTEZAMI) { tempInflec = inflectionIter; break; } } if (shakhsType == PersonType.PERSON_NONE) shakhsType = tempInflec.Person; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 35 case 35: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); shakhsType = PersonType.THIRD_PERSON_SINGULAR; if (tokens.Length == 3) { if (tokens[2] == "نیست") { positivity = TensePositivity.NEGATIVE; } else { positivity = TensePositivity.POSITIVE; } } else { positivity = TensePositivity.POSITIVE; } zamirPeyvastehType = AttachedPronounType.AttachedPronoun_NONE; zamirString = ""; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 36 case 36: tenseFormationType = TenseFormationType.GOZASHTEH_BAEED; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[2]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_SADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; positivity = TensePositivity.POSITIVE; tempInfleclist = VerbList.VerbShapes[tokens[2]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_SADEH) { tempInflec = inflectionIter; break; } } zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 37 case 37: tenseFormationType = TenseFormationType.GOZASHTEH_ELTEZAMI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[2]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_SAADEH || inflectionIter.TenseForm == TenseFormationType.HAAL_ELTEZAMI) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; positivity = TensePositivity.POSITIVE; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 40 case 40: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); shakhsType = PersonType.THIRD_PERSON_SINGULAR; if (tokens.Length == 3) { if (tokens[2] == "نیست") { positivity = TensePositivity.NEGATIVE; } else { positivity = TensePositivity.POSITIVE; } } else { positivity = TensePositivity.POSITIVE; } zamirPeyvastehType = AttachedPronounType.AttachedPronoun_NONE; zamirString = ""; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 43 case 43: tenseFormationType = TenseFormationType.GOZASHTEH_BAEED; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[2]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_SADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; positivity = TensePositivity.NEGATIVE; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 44 case 44: tenseFormationType = TenseFormationType.GOZASHTEH_ELTEZAMI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[2]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_SAADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; positivity = TensePositivity.NEGATIVE; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 45 case 45: tenseFormationType = TenseFormationType.GOZASHTEH_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; verb = new Verb(verb.PrepositionOfVerb, "کرد", "کن", verb.Prefix, verb.NonVerbalElement, VerbTransitivity.Transitive, verb.Type, true, "?", "@", "!"); shakhsType = PersonType.THIRD_PERSON_SINGULAR; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 46 case 46: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_SADEH) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); verb = new Verb(verb.PrepositionOfVerb, "کرد", "کن", verb.Prefix, verb.NonVerbalElement, VerbTransitivity.Transitive, verb.Type, true, "?", "@", "!"); shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 47 case 47: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); verb = new Verb(verb.PrepositionOfVerb, "کرد", "کن", verb.Prefix, verb.NonVerbalElement, VerbTransitivity.Transitive, verb.Type, true, "?", "@", "!"); shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 48 case 48: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); verb = new Verb(verb.PrepositionOfVerb, "کرد", "کن", verb.Prefix, verb.NonVerbalElement, VerbTransitivity.Transitive, verb.Type, true, "?", "@", "!"); shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 49 case 49: tenseFormationType = TenseFormationType.GOZASHTEH_BAEED; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); verb = new Verb(verb.PrepositionOfVerb, "کرد", "کن", verb.Prefix, verb.NonVerbalElement, VerbTransitivity.Transitive, verb.Type, true, "?", "@", "!"); shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 50 case 50: tenseFormationType = TenseFormationType.GOZASHTEH_ELTEZAMI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); verb = new Verb(verb.PrepositionOfVerb, "کرد", "کن", verb.Prefix, verb.NonVerbalElement, VerbTransitivity.Transitive, verb.Type, true, "?", "@", "!"); shakhsType = tempInflec.Person; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 51 case 51: tenseFormationType = TenseFormationType.GOZASHTEH_ABAD; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_SADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Person; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 52 case 52: tenseFormationType = TenseFormationType.GOZASHTEH_ABAD; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } if (tempInflec!=null){ positivity = tempInflec.Positivity; passivity=TensePassivity.PASSIVE; } shakhsType = PersonType.THIRD_PERSON_SINGULAR; zamirPeyvastehType = AttachedPronounType.AttachedPronoun_NONE; zamirString = ""; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region default default: VerbInflection nullinflec = null; if (i == output.Count - 1 && output[i].Value == 1) { tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; shakhsType = PersonType.THIRD_PERSON_SINGULAR; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); } else if (i == output.Count - 1 && output[i].Value == 5) { tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; shakhsType = PersonType.THIRD_PERSON_SINGULAR; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); } else if (i == output.Count - 1 && output[i].Value == 4) { tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; shakhsType = PersonType.THIRD_PERSON_SINGULAR; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); } else if (i == output.Count - 1 && output[i].Value == 7) { tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.VerbRoot.PastTenseRoot == "شد") { tempInflec = inflectionIter; break; } } positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; shakhsType = PersonType.THIRD_PERSON_SINGULAR; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); } else if (i == output.Count - 1 && output[i].Value == 6) { tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; shakhsType = PersonType.THIRD_PERSON_SINGULAR; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); } else if (i == output.Count - 1 && output[i].Value == 9) { tenseFormationType = TenseFormationType.GOZASHTEH_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbRoot.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.AttachedPronounString; verb = new Verb(verb.PrepositionOfVerb, "کرد", "کن", verb.Prefix, verb.NonVerbalElement, VerbTransitivity.Transitive, verb.Type, true, "?", "@", "!"); shakhsType = PersonType.THIRD_PERSON_SINGULAR; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); } else { outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, nullinflec)); } break; #endregion } } return outputResults; }
private static List<string> GetGozashtehNaghliEstemraiSadehInflections(VerbInflection inflection) { var lstInflections = new List<string>(); var verbBuilder = new StringBuilder(); verbBuilder.Append(inflection.VerbRoot.Prefix); switch (inflection.Positivity) { case TensePositivity.POSITIVE: verbBuilder.Append("می" ); break; case TensePositivity.NEGATIVE: verbBuilder.Append("نمی" ); break; } var verb = new Verb("", inflection.VerbRoot.PastTenseRoot, inflection.VerbRoot.PresentTenseRoot, "", "", inflection.VerbRoot.Transitivity, VerbType.SADEH, inflection.VerbRoot.CanBeImperative, inflection.VerbRoot.PresentRootConsonantVowelEndStem,inflection.VerbRoot.PastRootVowelStart,inflection.VerbRoot.PresentRootVowelStart); var verbInflection = new VerbInflection(verb, AttachedPronounType.AttachedPronoun_NONE,"", PersonType.PERSON_NONE, TenseFormationType.PAYEH_MAFOOLI, TensePositivity.POSITIVE); var tempLst = GetPayehFelInflections(verbInflection); verbBuilder.Append(tempLst[0]); switch (inflection.Person) { case PersonType.THIRD_PERSON_PLURAL: verbBuilder.Append( "اند"); break; case PersonType.SECOND_PERSON_SINGULAR: verbBuilder.Append("ای"); break; case PersonType.SECOND_PERSON_PLURAL: verbBuilder.Append( "اید"); break; case PersonType.FIRST_PERSON_SINGULAR: verbBuilder.Append("ام"); break; case PersonType.FIRST_PERSON_PLURAL: verbBuilder.Append( "ایم"); break; } lstInflections.Add(AddAttachedPronoun(verbBuilder.ToString(), inflection)); return lstInflections; }
/// <summary> /// /// </summary> /// <returns>An exact copy of the object with different memory reference values</returns> public Verb Clone() { var vrb=new Verb(PrepositionOfVerb,PastTenseRoot,PresentTenseRoot,Prefix,NonVerbalElement,Transitivity,Type,CanBeImperative,PresentRootConsonantVowelEndStem,PastRootVowelStart,PresentRootVowelStart); return vrb; }
public Verb Clone() { var vrb = new Verb(HarfeEzafeh, HastehMazi, HastehMozareh, Pishvand, Felyar, Transitivity, Type, AmrShodani, HastehMozarehConsonantVowelEndStem, HastehMaziVowelStart, HastehMozarehVowelStart); return vrb; }
private static List<string> GetGozashtehNaghliEstemraiSadehInflections(VerbInflection inflection) { var lstInflections = new List<string>(); var verbBuilder = new StringBuilder(); verbBuilder.Append(inflection.VerbStem.Pishvand); switch (inflection.Positivity) { case TensePositivity.POSITIVE: verbBuilder.Append("می"); break; case TensePositivity.NEGATIVE: verbBuilder.Append("نمی"); break; } var verb = new Verb("", inflection.VerbStem.HastehMazi, inflection.VerbStem.HastehMozareh, "", "", inflection.VerbStem.Transitivity, VerbType.SADEH, inflection.VerbStem.AmrShodani, inflection.VerbStem.HastehMozarehConsonantVowelEndStem, inflection.VerbStem.HastehMaziVowelStart, inflection.VerbStem.HastehMozarehVowelStart); var verbInflection = new VerbInflection(verb, ZamirPeyvastehType.ZamirPeyvasteh_NONE, "", ShakhsType.Shakhs_NONE, TenseFormationType.PAYEH_MAFOOLI, TensePositivity.POSITIVE); var tempLst = GetPayehFelInflections(verbInflection); verbBuilder.Append(tempLst[0]); switch (inflection.Shakhs) { case ShakhsType.SEVVOMSHAKHS_JAM: verbBuilder.Append("اند"); break; case ShakhsType.DOVVOMSHAKHS_MOFRAD: verbBuilder.Append("ای"); break; case ShakhsType.DOVVOMSHAKHS_JAM: verbBuilder.Append("اید"); break; case ShakhsType.AVALSHAKHS_MOFRAD: verbBuilder.Append("ام"); break; case ShakhsType.AVALSHAKHS_JAM: verbBuilder.Append("ایم"); break; } lstInflections.Add(AddZamirPeyvasteh(verbBuilder.ToString(), inflection)); return lstInflections; }
/// <summary> /// Constructs all dictionaries used in the inflection program /// </summary> /// <param name="verbDicPath"></param> public VerbList(string verbDicPath) { VerbPishvandiDic = new Dictionary<string, List<string>>(); VerbShapes = new Dictionary<string, List<VerbInflection>>(); CompoundVerbDic = new Dictionary<Verb, Dictionary<string, Dictionary<string, bool>>>(); var verbs = new List<Verb>(); string[] records = File.ReadAllText(verbDicPath).Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); foreach (var record in records) { string[] fields = record.Split("\t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); int vtype = int.Parse(fields[0]); if (vtype == 1 || vtype == 2) { var verbType = VerbType.SADEH; if (vtype == 2) verbType = VerbType.PISHVANDI; int trans = int.Parse(fields[1]); var transitivity = VerbTransitivity.Transitive; if (trans == 0) transitivity = VerbTransitivity.InTransitive; else if (trans == 2) transitivity = VerbTransitivity.BiTransitive; string pishvand = ""; if (fields[5] != "-") { pishvand = fields[5]; } Verb verb; bool amrShodani = true; if (fields[7] == "*") amrShodani = false; string vowelEnd = fields[8]; string maziVowel = fields[9]; string mozarehVowel = fields[10]; if (fields[3] == "-") verb = new Verb("", fields[2], "", pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else if (fields[2] == "-") verb = new Verb("", "", fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else verb = new Verb("", fields[2], fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); verbs.Add(verb); if (verb.Type == VerbType.PISHVANDI) { verbs.Add(new Verb("", "", "خواه", pishvand, "", VerbTransitivity.InTransitive, VerbType.AYANDEH_PISHVANDI, false, "?", "@", "!")); if (VerbPishvandiDic.ContainsKey(pishvand)) { VerbPishvandiDic[pishvand].Add(verb.PastTenseRoot + "|" + verb.PresentTenseRoot); } else { var lst = new List<string>(); lst.Add(verb.PastTenseRoot + "|" + verb.PresentTenseRoot); VerbPishvandiDic.Add(pishvand, lst); } } } else if (vtype == 3) { var verbType = VerbType.SADEH; int trans = int.Parse(fields[1]); VerbTransitivity transitivity = VerbTransitivity.Transitive; if (trans == 0) transitivity = VerbTransitivity.InTransitive; else if (trans == 2) transitivity = VerbTransitivity.BiTransitive; Verb verb; bool amrShodani = true; string vowelEnd = fields[8]; string maziVowel = fields[9]; string mozarehVowel = fields[10]; string nonVerbalElemant = fields[4]; if (fields[3] == "-") verb = new Verb("", fields[2], "", "", "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else if (fields[2] == "-") verb = new Verb("", "", fields[3], "", "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else verb = new Verb("", fields[2], fields[3], "", "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); if (fields[7] == "*") amrShodani = false; var istran=true; if(transitivity==VerbTransitivity.InTransitive) istran=false; if (!CompoundVerbDic.ContainsKey(verb)) CompoundVerbDic.Add(verb, new Dictionary<string, Dictionary<string, bool>>()); if (!CompoundVerbDic[verb].ContainsKey(nonVerbalElemant)) { CompoundVerbDic[verb].Add(nonVerbalElemant, new Dictionary<string, bool>()); } if (!CompoundVerbDic[verb][nonVerbalElemant].ContainsKey("")) CompoundVerbDic[verb][nonVerbalElemant].Add("", istran); } else if (vtype == 4) { var verbType = VerbType.PISHVANDI; int trans = int.Parse(fields[1]); VerbTransitivity transitivity = VerbTransitivity.Transitive; if (trans == 0) transitivity = VerbTransitivity.InTransitive; else if (trans == 2) transitivity = VerbTransitivity.BiTransitive; Verb verb; string pishvand = ""; if (fields[5] != "-") { pishvand = fields[5]; } bool amrShodani = true; string vowelEnd = fields[8]; string maziVowel = fields[9]; string mozarehVowel = fields[10]; string nonVerbalElemant = fields[4]; if (fields[3] == "-") verb = new Verb("", fields[2], "", pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else if (fields[2] == "-") verb = new Verb("", "", fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else verb = new Verb("", fields[2], fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); if (fields[7] == "*") amrShodani = false; var istrans=true; if(transitivity==VerbTransitivity.InTransitive) istrans=false; if (!CompoundVerbDic.ContainsKey(verb)) CompoundVerbDic.Add(verb, new Dictionary<string, Dictionary<string, bool>>()); if (!CompoundVerbDic[verb].ContainsKey(nonVerbalElemant)) { CompoundVerbDic[verb].Add(nonVerbalElemant, new Dictionary<string, bool>()); } if (!CompoundVerbDic[verb][nonVerbalElemant].ContainsKey("")) CompoundVerbDic[verb][nonVerbalElemant].Add("", istrans); } else if (vtype == 5 || vtype == 7) { var verbType = VerbType.SADEH; int trans = int.Parse(fields[1]); VerbTransitivity transitivity = VerbTransitivity.Transitive; if (trans == 0) transitivity = VerbTransitivity.InTransitive; else if (trans == 2) transitivity = VerbTransitivity.BiTransitive; Verb verb; string pishvand = ""; if (fields[5] != "-") { pishvand = fields[5]; } if (pishvand != "") { verbType = VerbType.PISHVANDI; } bool amrShodani = true; string vowelEnd = fields[8]; string maziVowel = fields[9]; string mozarehVowel = fields[10]; string nonVerbalElemant = fields[4]; string harfeEazafeh = fields[6]; if (fields[3] == "-") verb = new Verb("", fields[2], "", pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else if (fields[2] == "-") verb = new Verb("", "", fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else verb = new Verb("", fields[2], fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); if (fields[7] == "*") amrShodani = false; var istrans=true; if(transitivity==VerbTransitivity.InTransitive) istrans=false; if (!CompoundVerbDic.ContainsKey(verb)) CompoundVerbDic.Add(verb, new Dictionary<string, Dictionary<string, bool>>()); if (!CompoundVerbDic[verb].ContainsKey(nonVerbalElemant)) { CompoundVerbDic[verb].Add(nonVerbalElemant, new Dictionary<string, bool>()); } if (!CompoundVerbDic[verb][nonVerbalElemant].ContainsKey(harfeEazafeh)) CompoundVerbDic[verb][nonVerbalElemant].Add(harfeEazafeh, istrans); } } var verbtext = new StringBuilder(); var mitavanInflection = new VerbInflection(new Verb("", "", "توان", "", "", VerbTransitivity.InTransitive, VerbType.SADEH, false, "?", "@", "!"), AttachedPronounType.AttachedPronoun_NONE, "", PersonType.PERSON_NONE, TenseFormationType.HAAL_SAADEH, TensePositivity.POSITIVE); VerbShapes.Add("میتوان", new List<VerbInflection>()); VerbShapes["میتوان"].Add(mitavanInflection); var nemitavanInflection = new VerbInflection(new Verb("", "", "توان", "", "", VerbTransitivity.InTransitive, VerbType.SADEH, false, "?", "@", "!"), AttachedPronounType.AttachedPronoun_NONE, "", PersonType.PERSON_NONE, TenseFormationType.HAAL_SAADEH, TensePositivity.POSITIVE); VerbShapes.Add("نمیتوان", new List<VerbInflection>()); VerbShapes["نمیتوان"].Add(nemitavanInflection); VerbShapes.Add("میتوان", new List<VerbInflection>()); VerbShapes["میتوان"].Add(mitavanInflection); VerbShapes.Add("نمیتوان", new List<VerbInflection>()); VerbShapes["نمیتوان"].Add(nemitavanInflection); var betavanInflection = new VerbInflection(new Verb("", "", "توان", "", "", VerbTransitivity.InTransitive, VerbType.SADEH, false, "?", "@", "!"), AttachedPronounType.AttachedPronoun_NONE, "", PersonType.PERSON_NONE, TenseFormationType.HAAL_ELTEZAMI, TensePositivity.POSITIVE); VerbShapes.Add("بتوان", new List<VerbInflection>()); VerbShapes["بتوان"].Add(betavanInflection); var naitavanInflection = new VerbInflection(new Verb("", "", "توان", "", "", VerbTransitivity.InTransitive, VerbType.SADEH, false, "?", "@", "!"), AttachedPronounType.AttachedPronoun_NONE, "", PersonType.PERSON_NONE, TenseFormationType.HAAL_ELTEZAMI, TensePositivity.POSITIVE); VerbShapes.Add("نتوان", new List<VerbInflection>()); VerbShapes["نتوان"].Add(naitavanInflection); foreach (Verb verb in verbs) { if (verb.Type == VerbType.SADEH || verb.Type == VerbType.PISHVANDI || verb.Type == VerbType.AYANDEH_PISHVANDI) { foreach (TensePositivity positivity in Enum.GetValues(typeof(TensePositivity))) { foreach (PersonType shakhsType in Enum.GetValues(typeof(PersonType))) { foreach ( TenseFormationType tenseFormationType in Enum.GetValues(typeof(TenseFormationType))) { foreach ( AttachedPronounType zamirPeyvastehType in Enum.GetValues(typeof(AttachedPronounType))) { var inflection = new VerbInflection(verb, zamirPeyvastehType, "", shakhsType, tenseFormationType, positivity); if (inflection.IsValid()) { var output = InflectorAnalyzeSentencer.GetInflections(inflection); if (inflection.VerbRoot.PastTenseRoot == "بایست") { if (output[0].Contains("بایست")) { inflection.Person = PersonType.PERSON_NONE; inflection.TenseForm = TenseFormationType.GOZASHTEH_SADEH; } else { inflection.Person = PersonType.PERSON_NONE; inflection.TenseForm = TenseFormationType.HAAL_SAADEH; } } var output2=new List<string>(); foreach (string list in output) { output2.Add (list); //Console.WriteLine(list); if (list.Contains("می")){ var newshape=list.Replace("می","می"); output2.Add (newshape); //Console.WriteLine(newshape); } } foreach (string list in output2) { if (!(VerbShapes.ContainsKey(list))) { var verbInflections = new List<VerbInflection> { inflection }; VerbShapes.Add(list, verbInflections); } else { bool contains = false; foreach (VerbInflection inf in VerbShapes[list]) { if (inflection.Equals(inf)) { contains = true; break; } } if (!contains) { //This for zamir_peyvaste rule based disambiguation in which the inflections //without zamir_peyvaste are rathered to remain for (int i = 0; i < VerbShapes[list].Count; i++) { var verbInflection = VerbShapes[list][i]; if (verbInflection.ZamirPeyvasteh != AttachedPronounType.AttachedPronoun_NONE) { VerbShapes[list].Remove(verbInflection); } } VerbShapes[list].Add(inflection); } } } } } } } } } } }
public static Dictionary<int, KeyValuePair<string, VerbInflection>> GetVerbTokens(string[] sentence, string[] posTokens, out string[] newPosTokens, string[] lemmas, out string[] outLemmas, string verbDicPath) { var outputResults = new Dictionary<int, KeyValuePair<string, VerbInflection>>(); var output = GetOutputResult(sentence, posTokens, out newPosTokens, lemmas, out outLemmas, verbDicPath); for (int i = 0; i < output.Count; i++) { var values = output[i]; VerbInflection inflection; TensePassivity passivity; TensePositivity positivity; Verb verb; ShakhsType shakhsType; TenseFormationType tenseFormationType; ZamirPeyvastehType zamirPeyvastehType; string zamirString; List<VerbInflection> tempInfleclist; VerbInflection tempInflec; string[] tokens = output[i].Key.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); switch (values.Value) { #region 10 case 10: tenseFormationType = TenseFormationType.HAAL_SAADEH_EKHBARI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_SAADEH_EKHBARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; zamirString = tempInflec.ZamirPeyvastehString; shakhsType = tempInflec.Shakhs; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 14 case 14: tenseFormationType = TenseFormationType.HAAL_ELTEZAMI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_ELTEZAMI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; zamirString = tempInflec.ZamirPeyvastehString; shakhsType = tempInflec.Shakhs; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 15 case 15: tenseFormationType = TenseFormationType.AMR; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.AMR) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; zamirString = tempInflec.ZamirPeyvastehString; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; shakhsType = tempInflec.Shakhs; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 17 case 17: tenseFormationType = TenseFormationType.GOZASHTEH_SADEH; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_SADEH) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; zamirString = tempInflec.ZamirPeyvastehString; shakhsType = tempInflec.Shakhs; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 18 case 18: tenseFormationType = TenseFormationType.GOZASHTEH_ESTEMRAARI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_ESTEMRAARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; zamirString = tempInflec.ZamirPeyvastehString; shakhsType = tempInflec.Shakhs; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 20 case 20: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_SADEH) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; shakhsType = tempInflec.Shakhs; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 21 case 21: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; shakhsType = tempInflec.Shakhs; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 11 case 11: tenseFormationType = TenseFormationType.HAAL_SAADEH_EKHBARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_SAADEH_EKHBARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); verb.HastehMazi = "کرد"; verb.HastehMozareh = "کن"; shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 16 case 16: tenseFormationType = TenseFormationType.AMR; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.AMR) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); verb.HastehMazi = "کرد"; verb.HastehMozareh = "کن"; shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 12 case 12: tenseFormationType = TenseFormationType.HAAL_ELTEZAMI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_ELTEZAMI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); verb.HastehMazi = "کرد"; verb.HastehMozareh = "کن"; shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 13 case 13: tenseFormationType = TenseFormationType.GOZASHTEH_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_SADEH) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); verb.HastehMazi = "کرد"; verb.HastehMozareh = "کن"; shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 19 case 19: tenseFormationType = TenseFormationType.GOZASHTEH_ESTEMRAARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_ESTEMRAARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); verb.HastehMazi = "کرد"; verb.HastehMozareh = "کن"; shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 22 case 22: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_SADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 23 case 23: tenseFormationType = TenseFormationType.GOZASHTEH_ESTEMRAARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_ESTEMRAARI) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 24 case 24: tenseFormationType = TenseFormationType.HAAL_SAADEH_EKHBARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_SAADEH_EKHBARI) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 25 case 25: tenseFormationType = TenseFormationType.HAAL_ELTEZAMI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_ELTEZAMI) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 26 case 26: tenseFormationType = TenseFormationType.GOZASHTEH_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_SADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 27 case 27: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); shakhsType = ShakhsType.SEVVOMSHAKHS_MOFRAD; if (tokens.Length == 2) { if (tokens[1] == "نیست") { positivity = TensePositivity.NEGATIVE; } else { positivity = TensePositivity.POSITIVE; } } else { positivity = TensePositivity.POSITIVE; } zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 28 case 28: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 29 case 29: tenseFormationType = TenseFormationType.GOZASHTEH_BAEED; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_SADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 30 case 30: tenseFormationType = TenseFormationType.GOZASHTEH_ELTEZAMI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_ELTEZAMI) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 31 case 31: tenseFormationType = TenseFormationType.AAYANDEH; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_SAADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; tempInfleclist = VerbList.VerbShapes[tokens[1]]; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; verb = new Verb("", tempInflec.VerbStem.HastehMazi, tempInflec.VerbStem.HastehMozareh, tempInflec.VerbStem.Pishvand, "", VerbTransitivity.GOZARA, tempInflec.VerbStem.Type, true, tempInflec.VerbStem.HastehMozarehConsonantVowelEndStem, tempInflec.VerbStem.HastehMaziVowelStart, tempInflec.VerbStem.HastehMozarehVowelStart); tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.IsPayehFelMasdari()) { tempInflec = inflectionIter; break; } } verb.HastehMazi = tempInflec.VerbStem.HastehMazi; verb.HastehMozareh = tempInflec.VerbStem.HastehMozareh; verb.Transitivity = tempInflec.VerbStem.Transitivity; verb.AmrShodani = tempInflec.VerbStem.AmrShodani; verb.HastehMozarehConsonantVowelEndStem = tempInflec.VerbStem.HastehMozarehConsonantVowelEndStem; verb.HastehMaziVowelStart = tempInflec.VerbStem.HastehMaziVowelStart; verb.HastehMozarehVowelStart = tempInflec.VerbStem.HastehMozarehVowelStart; if (zamirPeyvastehType == ZamirPeyvastehType.ZamirPeyvasteh_NONE) zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 32 case 32: tenseFormationType = TenseFormationType.AAYANDEH; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_SAADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; tempInfleclist = VerbList.VerbShapes[tokens[1]]; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; verb = new Verb("", tempInflec.VerbStem.HastehMazi, tempInflec.VerbStem.HastehMozareh, tempInflec.VerbStem.Pishvand, "", VerbTransitivity.GOZARA, tempInflec.VerbStem.Type, true, tempInflec.VerbStem.HastehMozarehConsonantVowelEndStem, tempInflec.VerbStem.HastehMaziVowelStart, tempInflec.VerbStem.HastehMozarehVowelStart); tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.IsPayehFelMasdari()) { tempInflec = inflectionIter; break; } } verb.HastehMazi = "کرد"; verb.HastehMozareh = "کن"; verb.Transitivity = VerbTransitivity.GOZARA; verb.AmrShodani = tempInflec.VerbStem.AmrShodani; verb.HastehMozarehConsonantVowelEndStem = tempInflec.VerbStem.HastehMozarehConsonantVowelEndStem; verb.HastehMaziVowelStart = tempInflec.VerbStem.HastehMaziVowelStart; verb.HastehMozarehVowelStart = tempInflec.VerbStem.HastehMozarehVowelStart; if (zamirPeyvastehType == ZamirPeyvastehType.ZamirPeyvasteh_NONE) zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 34 case 34: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; shakhsType = ShakhsType.SEVVOMSHAKHS_MOFRAD; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 38,39 case 38: case 39: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; shakhsType = ShakhsType.SEVVOMSHAKHS_MOFRAD; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 41 case 41: tenseFormationType = TenseFormationType.GOZASHTEH_BAEED; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; positivity = tempInflec.Positivity; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_SADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 42 case 42: tenseFormationType = TenseFormationType.GOZASHTEH_ELTEZAMI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; positivity = tempInflec.Positivity; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_ELTEZAMI) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 33 case 33: tenseFormationType = TenseFormationType.AAYANDEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_ELTEZAMI) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; tempInfleclist = VerbList.VerbShapes[tokens[2]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_ELTEZAMI) { tempInflec = inflectionIter; break; } } if (shakhsType == ShakhsType.Shakhs_NONE) shakhsType = tempInflec.Shakhs; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 35 case 35: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); shakhsType = ShakhsType.SEVVOMSHAKHS_MOFRAD; if (tokens.Length == 3) { if (tokens[2] == "نیست") { positivity = TensePositivity.NEGATIVE; } else { positivity = TensePositivity.POSITIVE; } } else { positivity = TensePositivity.POSITIVE; } zamirPeyvastehType = ZamirPeyvastehType.ZamirPeyvasteh_NONE; zamirString = ""; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 36 case 36: tenseFormationType = TenseFormationType.GOZASHTEH_BAEED; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[2]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_SADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; positivity = TensePositivity.POSITIVE; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 37 case 37: tenseFormationType = TenseFormationType.GOZASHTEH_ELTEZAMI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[2]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_SAADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; positivity = TensePositivity.POSITIVE; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 40 case 40: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); shakhsType = ShakhsType.SEVVOMSHAKHS_MOFRAD; if (tokens.Length == 3) { if (tokens[2] == "نیست") { positivity = TensePositivity.NEGATIVE; } else { positivity = TensePositivity.POSITIVE; } } else { positivity = TensePositivity.POSITIVE; } zamirPeyvastehType = ZamirPeyvastehType.ZamirPeyvasteh_NONE; zamirString = ""; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 43 case 43: tenseFormationType = TenseFormationType.GOZASHTEH_BAEED; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[2]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_SADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; positivity = TensePositivity.NEGATIVE; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 44 case 44: tenseFormationType = TenseFormationType.GOZASHTEH_ELTEZAMI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[2]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.HAAL_SAADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; positivity = TensePositivity.NEGATIVE; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 45 case 45: tenseFormationType = TenseFormationType.GOZASHTEH_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; verb = new Verb(verb.HarfeEzafeh, "کرد", "کن", verb.Pishvand, verb.Felyar, VerbTransitivity.GOZARA, verb.Type, true, "?", "@", "!"); shakhsType = ShakhsType.SEVVOMSHAKHS_MOFRAD; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 46 case 46: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_SADEH) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); verb = new Verb(verb.HarfeEzafeh, "کرد", "کن", verb.Pishvand, verb.Felyar, VerbTransitivity.GOZARA, verb.Type, true, "?", "@", "!"); shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 47 case 47: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); verb = new Verb(verb.HarfeEzafeh, "کرد", "کن", verb.Pishvand, verb.Felyar, VerbTransitivity.GOZARA, verb.Type, true, "?", "@", "!"); shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 48 case 48: tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); verb = new Verb(verb.HarfeEzafeh, "کرد", "کن", verb.Pishvand, verb.Felyar, VerbTransitivity.GOZARA, verb.Type, true, "?", "@", "!"); shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 49 case 49: tenseFormationType = TenseFormationType.GOZASHTEH_BAEED; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); verb = new Verb(verb.HarfeEzafeh, "کرد", "کن", verb.Pishvand, verb.Felyar, VerbTransitivity.GOZARA, verb.Type, true, "?", "@", "!"); shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 50 case 50: tenseFormationType = TenseFormationType.GOZASHTEH_ELTEZAMI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); verb = new Verb(verb.HarfeEzafeh, "کرد", "کن", verb.Pishvand, verb.Felyar, VerbTransitivity.GOZARA, verb.Type, true, "?", "@", "!"); shakhsType = tempInflec.Shakhs; positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 51 case 51: tenseFormationType = TenseFormationType.GOZASHTEH_ABAD; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_SADEH) { tempInflec = inflectionIter; break; } } shakhsType = tempInflec.Shakhs; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region 52 case 52: tenseFormationType = TenseFormationType.GOZASHTEH_ABAD; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; shakhsType = ShakhsType.SEVVOMSHAKHS_MOFRAD; zamirPeyvastehType = ZamirPeyvastehType.ZamirPeyvasteh_NONE; zamirString = ""; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); break; #endregion #region default default: VerbInflection nullinflec = null; if (i == output.Count - 1 && output[i].Value == 1) { tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; shakhsType = ShakhsType.SEVVOMSHAKHS_MOFRAD; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); } else if (i == output.Count - 1 && output[i].Value == 5) { tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; shakhsType = ShakhsType.SEVVOMSHAKHS_MOFRAD; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); } else if (i == output.Count - 1 && output[i].Value == 4) { tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_SADEH; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; shakhsType = ShakhsType.SEVVOMSHAKHS_MOFRAD; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); } else if (i == output.Count - 1 && output[i].Value == 7) { tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); tempInfleclist = VerbList.VerbShapes[tokens[1]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.VerbStem.HastehMazi == "شد") { tempInflec = inflectionIter; break; } } positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; shakhsType = ShakhsType.SEVVOMSHAKHS_MOFRAD; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); } else if (i == output.Count - 1 && output[i].Value == 6) { tenseFormationType = TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI; passivity = TensePassivity.ACTIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.GOZASHTEH_NAGHLI_ESTEMRAARI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; shakhsType = ShakhsType.SEVVOMSHAKHS_MOFRAD; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); } else if (i == output.Count - 1 && output[i].Value == 9) { tenseFormationType = TenseFormationType.GOZASHTEH_SADEH; passivity = TensePassivity.PASSIVE; tempInfleclist = VerbList.VerbShapes[tokens[0]]; tempInflec = null; foreach (VerbInflection inflectionIter in tempInfleclist) { if (inflectionIter.TenseForm == TenseFormationType.PAYEH_MAFOOLI) { tempInflec = inflectionIter; break; } } verb = tempInflec.VerbStem.Clone(); positivity = tempInflec.Positivity; zamirPeyvastehType = tempInflec.ZamirPeyvasteh; zamirString = tempInflec.ZamirPeyvastehString; verb = new Verb(verb.HarfeEzafeh, "کرد", "کن", verb.Pishvand, verb.Felyar, VerbTransitivity.GOZARA, verb.Type, true, "?", "@", "!"); shakhsType = ShakhsType.SEVVOMSHAKHS_MOFRAD; inflection = new VerbInflection(verb, zamirPeyvastehType, zamirString, shakhsType, tenseFormationType, positivity, passivity); outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, inflection)); } else { outputResults.Add(i, new KeyValuePair<string, VerbInflection>(output[i].Key, nullinflec)); } break; #endregion } } return outputResults; }
public VerbList(string verbDicPath) { if (VerbShapes == null) { VerbPishvandiDic = new Dictionary <string, List <string> >(); VerbShapes = new Dictionary <string, List <VerbInflection> >(); CompoundVerbDic = new Dictionary <Verb, Dictionary <string, Dictionary <string, bool> > >(); var verbs = new List <Verb>(); string[] records = File.ReadAllText(verbDicPath).Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); foreach (var record in records) { string[] fields = record.Split("\t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); int vtype = int.Parse(fields[0]); if (vtype == 1 || vtype == 2) { var verbType = VerbType.SADEH; if (vtype == 2) { verbType = VerbType.PISHVANDI; } int trans = int.Parse(fields[1]); var transitivity = VerbTransitivity.GOZARA; if (trans == 0) { transitivity = VerbTransitivity.NAGOZAR; } else if (trans == 2) { transitivity = VerbTransitivity.DOVAJHI; } string pishvand = ""; if (fields[5] != "-") { pishvand = fields[5]; } Verb verb; bool amrShodani = true; if (fields[7] == "*") { amrShodani = false; } string vowelEnd = fields[8]; string maziVowel = fields[9]; string mozarehVowel = fields[10]; if (fields[3] == "-") { verb = new Verb("", fields[2], "", pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); } else if (fields[2] == "-") { verb = new Verb("", "", fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); } else { verb = new Verb("", fields[2], fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); } verbs.Add(verb); if (verb.Type == VerbType.PISHVANDI) { verbs.Add(new Verb("", "", "خواه", pishvand, "", VerbTransitivity.NAGOZAR, VerbType.AYANDEH_PISHVANDI, false, "?", "@", "!")); if (VerbPishvandiDic.ContainsKey(pishvand)) { VerbPishvandiDic[pishvand].Add(verb.HastehMazi + "|" + verb.HastehMozareh); } else { var lst = new List <string>(); lst.Add(verb.HastehMazi + "|" + verb.HastehMozareh); VerbPishvandiDic.Add(pishvand, lst); } } } else if (vtype == 3) { var verbType = VerbType.SADEH; int trans = int.Parse(fields[1]); VerbTransitivity transitivity = VerbTransitivity.GOZARA; if (trans == 0) { transitivity = VerbTransitivity.NAGOZAR; } else if (trans == 2) { transitivity = VerbTransitivity.DOVAJHI; } Verb verb; bool amrShodani = true; string vowelEnd = fields[8]; string maziVowel = fields[9]; string mozarehVowel = fields[10]; string nonVerbalElemant = fields[4]; if (fields[3] == "-") { verb = new Verb("", fields[2], "", "", "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); } else if (fields[2] == "-") { verb = new Verb("", "", fields[3], "", "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); } else { verb = new Verb("", fields[2], fields[3], "", "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); } if (fields[7] == "*") { amrShodani = false; } if (!CompoundVerbDic.ContainsKey(verb)) { CompoundVerbDic.Add(verb, new Dictionary <string, Dictionary <string, bool> >()); } if (!CompoundVerbDic[verb].ContainsKey(nonVerbalElemant)) { CompoundVerbDic[verb].Add(nonVerbalElemant, new Dictionary <string, bool>()); } if (!CompoundVerbDic[verb][nonVerbalElemant].ContainsKey("")) { CompoundVerbDic[verb][nonVerbalElemant].Add("", amrShodani); } } else if (vtype == 4) { var verbType = VerbType.PISHVANDI; int trans = int.Parse(fields[1]); VerbTransitivity transitivity = VerbTransitivity.GOZARA; if (trans == 0) { transitivity = VerbTransitivity.NAGOZAR; } else if (trans == 2) { transitivity = VerbTransitivity.DOVAJHI; } Verb verb; string pishvand = ""; if (fields[5] != "-") { pishvand = fields[5]; } bool amrShodani = true; string vowelEnd = fields[8]; string maziVowel = fields[9]; string mozarehVowel = fields[10]; string nonVerbalElemant = fields[4]; if (fields[3] == "-") { verb = new Verb("", fields[2], "", pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); } else if (fields[2] == "-") { verb = new Verb("", "", fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); } else { verb = new Verb("", fields[2], fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); } if (fields[7] == "*") { amrShodani = false; } if (!CompoundVerbDic.ContainsKey(verb)) { CompoundVerbDic.Add(verb, new Dictionary <string, Dictionary <string, bool> >()); } if (!CompoundVerbDic[verb].ContainsKey(nonVerbalElemant)) { CompoundVerbDic[verb].Add(nonVerbalElemant, new Dictionary <string, bool>()); } if (!CompoundVerbDic[verb][nonVerbalElemant].ContainsKey("")) { CompoundVerbDic[verb][nonVerbalElemant].Add("", amrShodani); } } else if (vtype == 5 || vtype == 7) { var verbType = VerbType.SADEH; int trans = int.Parse(fields[1]); VerbTransitivity transitivity = VerbTransitivity.GOZARA; if (trans == 0) { transitivity = VerbTransitivity.NAGOZAR; } else if (trans == 2) { transitivity = VerbTransitivity.DOVAJHI; } Verb verb; string pishvand = ""; if (fields[5] != "-") { pishvand = fields[5]; } if (pishvand != "") { verbType = VerbType.PISHVANDI; } bool amrShodani = true; string vowelEnd = fields[8]; string maziVowel = fields[9]; string mozarehVowel = fields[10]; string nonVerbalElemant = fields[4]; string harfeEazafeh = fields[6]; if (fields[3] == "-") { verb = new Verb("", fields[2], "", pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); } else if (fields[2] == "-") { verb = new Verb("", "", fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); } else { verb = new Verb("", fields[2], fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); } if (fields[7] == "*") { amrShodani = false; } if (!CompoundVerbDic.ContainsKey(verb)) { CompoundVerbDic.Add(verb, new Dictionary <string, Dictionary <string, bool> >()); } if (!CompoundVerbDic[verb].ContainsKey(nonVerbalElemant)) { CompoundVerbDic[verb].Add(nonVerbalElemant, new Dictionary <string, bool>()); } if (!CompoundVerbDic[verb][nonVerbalElemant].ContainsKey(harfeEazafeh)) { CompoundVerbDic[verb][nonVerbalElemant].Add(harfeEazafeh, amrShodani); } } } var verbtext = new StringBuilder(); var mitavanInflection = new VerbInflection(new Verb("", "", "میتوان", "", "", VerbTransitivity.NAGOZAR, VerbType.SADEH, false, "?", "@", "!"), ZamirPeyvastehType.ZamirPeyvasteh_NONE, "", ShakhsType.Shakhs_NONE, TenseFormationType.HAAL_SAADEH, TensePositivity.POSITIVE); VerbShapes.Add("میتوان", new List <VerbInflection>()); VerbShapes["میتوان"].Add(mitavanInflection); var nemitavanInflection = new VerbInflection(new Verb("", "", "میتوان", "", "", VerbTransitivity.NAGOZAR, VerbType.SADEH, false, "?", "@", "!"), ZamirPeyvastehType.ZamirPeyvasteh_NONE, "", ShakhsType.Shakhs_NONE, TenseFormationType.HAAL_SAADEH, TensePositivity.POSITIVE); VerbShapes.Add("نمیتوان", new List <VerbInflection>()); VerbShapes["نمیتوان"].Add(nemitavanInflection); var betavanInflection = new VerbInflection(new Verb("", "", "بتوان", "", "", VerbTransitivity.NAGOZAR, VerbType.SADEH, false, "?", "@", "!"), ZamirPeyvastehType.ZamirPeyvasteh_NONE, "", ShakhsType.Shakhs_NONE, TenseFormationType.HAAL_ELTEZAMI, TensePositivity.POSITIVE); VerbShapes.Add("بتوان", new List <VerbInflection>()); VerbShapes["بتوان"].Add(betavanInflection); var naitavanInflection = new VerbInflection(new Verb("", "", "نتوان", "", "", VerbTransitivity.NAGOZAR, VerbType.SADEH, false, "?", "@", "!"), ZamirPeyvastehType.ZamirPeyvasteh_NONE, "", ShakhsType.Shakhs_NONE, TenseFormationType.HAAL_ELTEZAMI, TensePositivity.POSITIVE); VerbShapes.Add("نتوان", new List <VerbInflection>()); VerbShapes["نتوان"].Add(naitavanInflection); foreach (Verb verb in verbs) { if (verb.Type == VerbType.SADEH || verb.Type == VerbType.PISHVANDI || verb.Type == VerbType.AYANDEH_PISHVANDI) { foreach (TensePositivity positivity in Enum.GetValues(typeof(TensePositivity))) { foreach (ShakhsType shakhsType in Enum.GetValues(typeof(ShakhsType))) { foreach ( TenseFormationType tenseFormationType in Enum.GetValues(typeof(TenseFormationType))) { foreach ( ZamirPeyvastehType zamirPeyvastehType in Enum.GetValues(typeof(ZamirPeyvastehType))) { var inflection = new VerbInflection(verb, zamirPeyvastehType, "", shakhsType, tenseFormationType, positivity); if (inflection.IsValid()) { var output = InflectorManager.GetInflections(inflection); foreach (string list in output) { if (!(VerbShapes.ContainsKey(list))) { var verbInflections = new List <VerbInflection> { inflection }; VerbShapes.Add(list, verbInflections); } else { bool contains = false; foreach (VerbInflection inf in VerbShapes[list]) { if (inflection.Equals(inf)) { contains = true; break; } } if (!contains) { VerbShapes[list].Add(inflection); } } } } } } } } } } } }
public VerbList(string verbDicPath) { if (VerbShapes == null) { VerbPishvandiDic = new Dictionary<string, List<string>>(); VerbShapes = new Dictionary<string, List<VerbInflection>>(); CompoundVerbDic = new Dictionary<Verb, Dictionary<string, Dictionary<string, bool>>>(); var verbs = new List<Verb>(); string[] records = File.ReadAllText(verbDicPath).Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); foreach (var record in records) { string[] fields = record.Split("\t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); int vtype = int.Parse(fields[0]); if (vtype == 1 || vtype == 2) { var verbType = VerbType.SADEH; if (vtype == 2) verbType = VerbType.PISHVANDI; int trans = int.Parse(fields[1]); var transitivity = VerbTransitivity.GOZARA; if (trans == 0) transitivity = VerbTransitivity.NAGOZAR; else if (trans == 2) transitivity = VerbTransitivity.DOVAJHI; string pishvand = ""; if (fields[5] != "-") { pishvand = fields[5]; } Verb verb; bool amrShodani = true; if (fields[7] == "*") amrShodani = false; string vowelEnd = fields[8]; string maziVowel = fields[9]; string mozarehVowel = fields[10]; if (fields[3] == "-") verb = new Verb("", fields[2], "", pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else if (fields[2] == "-") verb = new Verb("", "", fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else verb = new Verb("", fields[2], fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); verbs.Add(verb); if (verb.Type == VerbType.PISHVANDI) { verbs.Add(new Verb("", "", "خواه", pishvand, "", VerbTransitivity.NAGOZAR, VerbType.AYANDEH_PISHVANDI, false, "?", "@", "!")); if (VerbPishvandiDic.ContainsKey(pishvand)) { VerbPishvandiDic[pishvand].Add(verb.HastehMazi + "|" + verb.HastehMozareh); } else { var lst = new List<string>(); lst.Add(verb.HastehMazi + "|" + verb.HastehMozareh); VerbPishvandiDic.Add(pishvand, lst); } } } else if (vtype == 3) { var verbType = VerbType.SADEH; int trans = int.Parse(fields[1]); VerbTransitivity transitivity = VerbTransitivity.GOZARA; if (trans == 0) transitivity = VerbTransitivity.NAGOZAR; else if (trans == 2) transitivity = VerbTransitivity.DOVAJHI; Verb verb; bool amrShodani = true; string vowelEnd = fields[8]; string maziVowel = fields[9]; string mozarehVowel = fields[10]; string nonVerbalElemant = fields[4]; if (fields[3] == "-") verb = new Verb("", fields[2], "", "", "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else if (fields[2] == "-") verb = new Verb("", "", fields[3], "", "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else verb = new Verb("", fields[2], fields[3], "", "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); if (fields[7] == "*") amrShodani = false; if (!CompoundVerbDic.ContainsKey(verb)) CompoundVerbDic.Add(verb, new Dictionary<string, Dictionary<string, bool>>()); if (!CompoundVerbDic[verb].ContainsKey(nonVerbalElemant)) { CompoundVerbDic[verb].Add(nonVerbalElemant, new Dictionary<string, bool>()); } if (!CompoundVerbDic[verb][nonVerbalElemant].ContainsKey("")) CompoundVerbDic[verb][nonVerbalElemant].Add("", amrShodani); } else if (vtype == 4) { var verbType = VerbType.PISHVANDI; int trans = int.Parse(fields[1]); VerbTransitivity transitivity = VerbTransitivity.GOZARA; if (trans == 0) transitivity = VerbTransitivity.NAGOZAR; else if (trans == 2) transitivity = VerbTransitivity.DOVAJHI; Verb verb; string pishvand = ""; if (fields[5] != "-") { pishvand = fields[5]; } bool amrShodani = true; string vowelEnd = fields[8]; string maziVowel = fields[9]; string mozarehVowel = fields[10]; string nonVerbalElemant = fields[4]; if (fields[3] == "-") verb = new Verb("", fields[2], "", pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else if (fields[2] == "-") verb = new Verb("", "", fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else verb = new Verb("", fields[2], fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); if (fields[7] == "*") amrShodani = false; if (!CompoundVerbDic.ContainsKey(verb)) CompoundVerbDic.Add(verb, new Dictionary<string, Dictionary<string, bool>>()); if (!CompoundVerbDic[verb].ContainsKey(nonVerbalElemant)) { CompoundVerbDic[verb].Add(nonVerbalElemant, new Dictionary<string, bool>()); } if (!CompoundVerbDic[verb][nonVerbalElemant].ContainsKey("")) CompoundVerbDic[verb][nonVerbalElemant].Add("", amrShodani); } else if (vtype == 5 || vtype == 7) { var verbType = VerbType.SADEH; int trans = int.Parse(fields[1]); VerbTransitivity transitivity = VerbTransitivity.GOZARA; if (trans == 0) transitivity = VerbTransitivity.NAGOZAR; else if (trans == 2) transitivity = VerbTransitivity.DOVAJHI; Verb verb; string pishvand = ""; if (fields[5] != "-") { pishvand = fields[5]; } if (pishvand != "") { verbType = VerbType.PISHVANDI; } bool amrShodani = true; string vowelEnd = fields[8]; string maziVowel = fields[9]; string mozarehVowel = fields[10]; string nonVerbalElemant = fields[4]; string harfeEazafeh = fields[6]; if (fields[3] == "-") verb = new Verb("", fields[2], "", pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else if (fields[2] == "-") verb = new Verb("", "", fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); else verb = new Verb("", fields[2], fields[3], pishvand, "", transitivity, verbType, amrShodani, vowelEnd, maziVowel, mozarehVowel); if (fields[7] == "*") amrShodani = false; if (!CompoundVerbDic.ContainsKey(verb)) CompoundVerbDic.Add(verb, new Dictionary<string, Dictionary<string, bool>>()); if (!CompoundVerbDic[verb].ContainsKey(nonVerbalElemant)) { CompoundVerbDic[verb].Add(nonVerbalElemant, new Dictionary<string, bool>()); } if (!CompoundVerbDic[verb][nonVerbalElemant].ContainsKey(harfeEazafeh)) CompoundVerbDic[verb][nonVerbalElemant].Add(harfeEazafeh, amrShodani); } } var verbtext = new StringBuilder(); var mitavanInflection = new VerbInflection(new Verb("", "", "میتوان", "", "", VerbTransitivity.NAGOZAR, VerbType.SADEH, false, "?", "@", "!"), ZamirPeyvastehType.ZamirPeyvasteh_NONE, "", ShakhsType.Shakhs_NONE, TenseFormationType.HAAL_SAADEH, TensePositivity.POSITIVE); VerbShapes.Add("میتوان", new List<VerbInflection>()); VerbShapes["میتوان"].Add(mitavanInflection); var nemitavanInflection = new VerbInflection(new Verb("", "", "میتوان", "", "", VerbTransitivity.NAGOZAR, VerbType.SADEH, false, "?", "@", "!"), ZamirPeyvastehType.ZamirPeyvasteh_NONE, "", ShakhsType.Shakhs_NONE, TenseFormationType.HAAL_SAADEH, TensePositivity.POSITIVE); VerbShapes.Add("نمیتوان", new List<VerbInflection>()); VerbShapes["نمیتوان"].Add(nemitavanInflection); var betavanInflection = new VerbInflection(new Verb("", "", "بتوان", "", "", VerbTransitivity.NAGOZAR, VerbType.SADEH, false, "?", "@", "!"), ZamirPeyvastehType.ZamirPeyvasteh_NONE, "", ShakhsType.Shakhs_NONE, TenseFormationType.HAAL_ELTEZAMI, TensePositivity.POSITIVE); VerbShapes.Add("بتوان", new List<VerbInflection>()); VerbShapes["بتوان"].Add(betavanInflection); var naitavanInflection = new VerbInflection(new Verb("", "", "نتوان", "", "", VerbTransitivity.NAGOZAR, VerbType.SADEH, false, "?", "@", "!"), ZamirPeyvastehType.ZamirPeyvasteh_NONE, "", ShakhsType.Shakhs_NONE, TenseFormationType.HAAL_ELTEZAMI, TensePositivity.POSITIVE); VerbShapes.Add("نتوان", new List<VerbInflection>()); VerbShapes["نتوان"].Add(naitavanInflection); foreach (Verb verb in verbs) { if (verb.Type == VerbType.SADEH || verb.Type == VerbType.PISHVANDI || verb.Type == VerbType.AYANDEH_PISHVANDI) { foreach (TensePositivity positivity in Enum.GetValues(typeof(TensePositivity))) { foreach (ShakhsType shakhsType in Enum.GetValues(typeof(ShakhsType))) { foreach ( TenseFormationType tenseFormationType in Enum.GetValues(typeof(TenseFormationType))) { foreach ( ZamirPeyvastehType zamirPeyvastehType in Enum.GetValues(typeof(ZamirPeyvastehType))) { var inflection = new VerbInflection(verb, zamirPeyvastehType, "", shakhsType, tenseFormationType, positivity); if (inflection.IsValid()) { var output = InflectorManager.GetInflections(inflection); foreach (string list in output) { if (!(VerbShapes.ContainsKey(list))) { var verbInflections = new List<VerbInflection> { inflection }; VerbShapes.Add(list, verbInflections); } else { bool contains = false; foreach (VerbInflection inf in VerbShapes[list]) { if (inflection.Equals(inf)) { contains = true; break; } } if (!contains) VerbShapes[list].Add(inflection); } } } } } } } } } } }