private void MakeMeVerySmart() { var text = inputTextBox.Text; var terms = text.Split(' '); progressBar.Maximum = terms.Length; progressBar.Value = 0; var synonymSelection = synonymSelectionBox.Controls.OfType <RadioButton>() .FirstOrDefault(r => r.Checked); if (synonymSelection != null) { _options.SynonymSelectionMode = synonymSelection.Text == SynonymSelectionMode.Longest.ToString() ? SynonymSelectionMode.Longest : SynonymSelectionMode.Random; _options.Complexity = GetComplexity(); } _generator.Options = _options; var verysmartText = _generator.MakeMeVerySmart(text); outputTextBox.Text = verysmartText; progressBar.Value = 0; }
private static string MakeMeVerySmart(string sentence) { var generator = new VerySmartGenerator { UsageResolver = GetSynonymList }; var options = new VerySmartOptions { SynonymSelectionMode = Config.Options[Config.OptionSelectRandom] ? SynonymSelectionMode.Random : SynonymSelectionMode.Longest, Complexity = WordComplexity.All }; generator.Options = options; return(generator.MakeMeVerySmart(sentence)); }