/// <summary> /// Creates the explore item. /// </summary> /// <param name="token">The token.</param> /// <returns></returns> public termExploreModel createExploreItem(string token) { //termExploreItem output = new termExploreItem(token); Match m = ruleSet.regex.Match(token); root = m.Groups[1].Value; stem = m.Groups[2].Value; sufix = m.Groups[3].Value; //output.gramSet = ruleSet.GetGramSet(this); morphRule rule = ruleSet.rules.First(); string lemmaForm = rule.GetForm(this); termExploreModel model = new termExploreModel(lemmaForm); model.gramSet = ruleSet.GetGramSet(rule.sufix); model.instances.AddRangeUnique(ruleSet.GetItems(this, lemmaForm)); model.lemma = new termExploreItem(lemmaForm); model.lemma.gramSet = model.gramSet; model.rootWord = root; return(model); }
/// <summary> /// Adds the specified sufix: $ is last letter of nominative, # is n, t or s /// </summary> /// <param name="sufix">The sufix.</param> /// <param name="gram">The gram.</param> /// <returns></returns> public morphRule Add(string sufix, gramFlags gram) { gram.type = type; morphRule output = new morphRule(sufix, gram); rules.Add(output); return(output); }