FormeleMethode/Automata.cs
/// <summary>
/// Generates the words in the language or not language
/// isLangue is bool for determin if it is the language or notLanguage
/// </summary>
/// <param name="word">The word.</param>
/// <param name="maxLength">The maximum length.</param>
/// <param name="wordList">The word list.</param>
/// <param name="isLanguage">if set to <c>true</c> [is language].</param>
Generates the words in the language or not language
isLangue is bool for determin if it is the language or notLanguage
Generates the words in the language or not language isLangue is bool for determin if it is the language or notLanguage
private void GenerateWords(string word, int maxLength, ref List<string> wordList, bool isLanguage)
		{
			if (word.Length >= maxLength)
				return;
			for (int i = 0; i < symbols.Count; i++)
			{
				var newWord = word + symbols.ToList()[i];
				if (Accept(newWord) && isLanguage)
				{
					wordList.Add(newWord);
				}
				else if (!Accept(newWord) && !isLanguage)
				{
					wordList.Add(newWord);
				}
				GenerateWords(newWord, maxLength, ref wordList, isLanguage);
			}
		}
private void GenerateWords ( string word , int maxLength , ref List < string > wordList , bool isLanguage ) { if ( word . Length >= maxLength ) return ; for ( int i = 0 ; i < symbols . Count ; i ++ ) { var newWord = word + symbols . ToList ( ) [ i ] ; if ( Accept ( newWord ) && isLanguage ) { wordList . Add ( newWord ) ; } else if ( ! Accept ( newWord ) && ! isLanguage ) { wordList . Add ( newWord ) ; } GenerateWords ( newWord , maxLength , ref wordList , isLanguage ) ; } }
Generates the words in the language or not language
isLangue is bool for determin if it is the language or notLanguage
Generates the words in the language or not language isLangue is bool for determin if it is the language or notLanguage
// Stop generating words // If we search language and word is accepted add it
word
string
None
maxLength
int
The maximum length.
The maximum length .
List<string>
ref
isLanguage
bool
if set to true
if set to true
wordList
The word list.
The word list .