Click here to Skip to main content
15,886,362 members
Articles / Programming Languages / C#

Wordmills are coming...

Rate me:
Please Sign up or sign in to vote.
4.75/5 (20 votes)
23 May 2008GPL311 min read 65.5K   586   41  
The article describes how a computer-being can be trained to write text articles, poems, compose music, or paint contemporary paintings.
namespace WordMills
{
        partial class Form1
        {
                /// <summary>
                /// Required designer variable.
                /// </summary>
                private System.ComponentModel.IContainer components = null;

                /// <summary>
                /// Clean up any resources being used.
                /// </summary>
                /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
                protected override void Dispose(bool disposing)
                {
                        if (disposing && (components != null))
                        {
                                components.Dispose();
                        }
                        base.Dispose(disposing);
                }

                #region Windows Form Designer generated code

                /// <summary>
                /// Required method for Designer support - do not modify
                /// the contents of this method with the code editor.
                /// </summary>
                private void InitializeComponent()
                {
                        this.learnButton = new System.Windows.Forms.Button();
                        this.progressLabel = new System.Windows.Forms.Label();
                        this.learnTextBackgroundWorker = new System.ComponentModel.BackgroundWorker();
                        this.stopLearnButton = new System.Windows.Forms.Button();
                        this.openTextFileDialog = new System.Windows.Forms.OpenFileDialog();
                        this.mainMenuStrip = new System.Windows.Forms.MenuStrip();
                        this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
                        this.saveDictionaryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
                        this.saveTextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
                        this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
                        this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
                        this.saveDictionaryDialog = new System.Windows.Forms.SaveFileDialog();
                        this.saveTextDialog = new System.Windows.Forms.SaveFileDialog();
                        this.simulationTextBox = new System.Windows.Forms.TextBox();
                        this.simulateButton = new System.Windows.Forms.Button();
                        this.sentencesNumberTextBox = new System.Windows.Forms.TextBox();
                        this.label1 = new System.Windows.Forms.Label();
                        this.label2 = new System.Windows.Forms.Label();
                        this.maxWordsPerSentenceTextBox = new System.Windows.Forms.TextBox();
                        this.mainMenuStrip.SuspendLayout();
                        this.SuspendLayout();
                        // 
                        // learnButton
                        // 
                        this.learnButton.Location = new System.Drawing.Point(12, 31);
                        this.learnButton.Name = "learnButton";
                        this.learnButton.Size = new System.Drawing.Size(59, 23);
                        this.learnButton.TabIndex = 0;
                        this.learnButton.Text = "Learn";
                        this.learnButton.UseVisualStyleBackColor = true;
                        this.learnButton.Click += new System.EventHandler(this.learnButton_Click);
                        // 
                        // progressLabel
                        // 
                        this.progressLabel.AutoSize = true;
                        this.progressLabel.Location = new System.Drawing.Point(77, 38);
                        this.progressLabel.Name = "progressLabel";
                        this.progressLabel.Size = new System.Drawing.Size(51, 13);
                        this.progressLabel.TabIndex = 1;
                        this.progressLabel.Text = "Progress:";
                        // 
                        // learnTextBackgroundWorker
                        // 
                        this.learnTextBackgroundWorker.WorkerReportsProgress = true;
                        this.learnTextBackgroundWorker.WorkerSupportsCancellation = true;
                        this.learnTextBackgroundWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.learnTextBackgroundWorker_DoWork);
                        this.learnTextBackgroundWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.learnTextBackgroundWorker_RunWorkerCompleted);
                        this.learnTextBackgroundWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.learnTextBackgroundWorker_ProgressChanged);
                        // 
                        // stopLearnButton
                        // 
                        this.stopLearnButton.Enabled = false;
                        this.stopLearnButton.Location = new System.Drawing.Point(12, 60);
                        this.stopLearnButton.Name = "stopLearnButton";
                        this.stopLearnButton.Size = new System.Drawing.Size(59, 23);
                        this.stopLearnButton.TabIndex = 2;
                        this.stopLearnButton.Text = "Stop";
                        this.stopLearnButton.UseVisualStyleBackColor = true;
                        this.stopLearnButton.Click += new System.EventHandler(this.stopLearnButton_Click);
                        // 
                        // openTextFileDialog
                        // 
                        this.openTextFileDialog.Filter = "Text files|*.txt";
                        this.openTextFileDialog.Multiselect = true;
                        // 
                        // mainMenuStrip
                        // 
                        this.mainMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.fileToolStripMenuItem});
                        this.mainMenuStrip.Location = new System.Drawing.Point(0, 0);
                        this.mainMenuStrip.Name = "mainMenuStrip";
                        this.mainMenuStrip.Size = new System.Drawing.Size(530, 24);
                        this.mainMenuStrip.TabIndex = 3;
                        this.mainMenuStrip.Text = "menuStrip1";
                        // 
                        // fileToolStripMenuItem
                        // 
                        this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.saveDictionaryToolStripMenuItem,
            this.saveTextToolStripMenuItem,
            this.toolStripMenuItem2,
            this.exitToolStripMenuItem});
                        this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
                        this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
                        this.fileToolStripMenuItem.Text = "File";
                        // 
                        // saveDictionaryToolStripMenuItem
                        // 
                        this.saveDictionaryToolStripMenuItem.Name = "saveDictionaryToolStripMenuItem";
                        this.saveDictionaryToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
                        this.saveDictionaryToolStripMenuItem.Text = "Save Dictionary";
                        this.saveDictionaryToolStripMenuItem.Click += new System.EventHandler(this.saveDictionaryToolStripMenuItem_Click);
                        // 
                        // saveTextToolStripMenuItem
                        // 
                        this.saveTextToolStripMenuItem.Name = "saveTextToolStripMenuItem";
                        this.saveTextToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
                        this.saveTextToolStripMenuItem.Text = "Save Text";
                        this.saveTextToolStripMenuItem.Click += new System.EventHandler(this.saveTextToolStripMenuItem_Click);
                        // 
                        // toolStripMenuItem2
                        // 
                        this.toolStripMenuItem2.Name = "toolStripMenuItem2";
                        this.toolStripMenuItem2.Size = new System.Drawing.Size(152, 6);
                        // 
                        // exitToolStripMenuItem
                        // 
                        this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
                        this.exitToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
                        this.exitToolStripMenuItem.Text = "Exit";
                        // 
                        // saveDictionaryDialog
                        // 
                        this.saveDictionaryDialog.DefaultExt = "dict";
                        this.saveDictionaryDialog.Filter = "Dictionaries|*.dict";
                        // 
                        // saveTextDialog
                        // 
                        this.saveTextDialog.DefaultExt = "txt";
                        this.saveTextDialog.Filter = "Text files|*.txt";
                        // 
                        // simulationTextBox
                        // 
                        this.simulationTextBox.Location = new System.Drawing.Point(80, 54);
                        this.simulationTextBox.MaxLength = 1048575;
                        this.simulationTextBox.Multiline = true;
                        this.simulationTextBox.Name = "simulationTextBox";
                        this.simulationTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
                        this.simulationTextBox.Size = new System.Drawing.Size(362, 256);
                        this.simulationTextBox.TabIndex = 4;
                        // 
                        // simulateButton
                        // 
                        this.simulateButton.Enabled = false;
                        this.simulateButton.Location = new System.Drawing.Point(449, 57);
                        this.simulateButton.Name = "simulateButton";
                        this.simulateButton.Size = new System.Drawing.Size(66, 23);
                        this.simulateButton.TabIndex = 5;
                        this.simulateButton.Text = "Simulate";
                        this.simulateButton.UseVisualStyleBackColor = true;
                        this.simulateButton.Click += new System.EventHandler(this.simulateButton_Click);
                        // 
                        // sentencesNumberTextBox
                        // 
                        this.sentencesNumberTextBox.Location = new System.Drawing.Point(451, 101);
                        this.sentencesNumberTextBox.Name = "sentencesNumberTextBox";
                        this.sentencesNumberTextBox.Size = new System.Drawing.Size(60, 20);
                        this.sentencesNumberTextBox.TabIndex = 6;
                        this.sentencesNumberTextBox.Text = "10";
                        // 
                        // label1
                        // 
                        this.label1.AutoSize = true;
                        this.label1.Location = new System.Drawing.Point(451, 88);
                        this.label1.Name = "label1";
                        this.label1.Size = new System.Drawing.Size(56, 13);
                        this.label1.TabIndex = 7;
                        this.label1.Text = "sentences";
                        // 
                        // label2
                        // 
                        this.label2.AutoSize = true;
                        this.label2.Location = new System.Drawing.Point(451, 124);
                        this.label2.Name = "label2";
                        this.label2.Size = new System.Drawing.Size(57, 13);
                        this.label2.TabIndex = 9;
                        this.label2.Text = "max words";
                        // 
                        // maxWordsPerSentenceTextBox
                        // 
                        this.maxWordsPerSentenceTextBox.Location = new System.Drawing.Point(451, 137);
                        this.maxWordsPerSentenceTextBox.Name = "maxWordsPerSentenceTextBox";
                        this.maxWordsPerSentenceTextBox.Size = new System.Drawing.Size(60, 20);
                        this.maxWordsPerSentenceTextBox.TabIndex = 8;
                        this.maxWordsPerSentenceTextBox.Text = "30";
                        // 
                        // Form1
                        // 
                        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                        this.ClientSize = new System.Drawing.Size(530, 322);
                        this.Controls.Add(this.label2);
                        this.Controls.Add(this.maxWordsPerSentenceTextBox);
                        this.Controls.Add(this.label1);
                        this.Controls.Add(this.sentencesNumberTextBox);
                        this.Controls.Add(this.simulateButton);
                        this.Controls.Add(this.simulationTextBox);
                        this.Controls.Add(this.stopLearnButton);
                        this.Controls.Add(this.progressLabel);
                        this.Controls.Add(this.learnButton);
                        this.Controls.Add(this.mainMenuStrip);
                        this.MainMenuStrip = this.mainMenuStrip;
                        this.MaximizeBox = false;
                        this.Name = "Form1";
                        this.Text = "WordMills.";
                        this.mainMenuStrip.ResumeLayout(false);
                        this.mainMenuStrip.PerformLayout();
                        this.ResumeLayout(false);
                        this.PerformLayout();

                }

                #endregion

                private System.Windows.Forms.Button learnButton;
                private System.Windows.Forms.Label progressLabel;
                private System.ComponentModel.BackgroundWorker learnTextBackgroundWorker;
                private System.Windows.Forms.Button stopLearnButton;
                private System.Windows.Forms.OpenFileDialog openTextFileDialog;
                private System.Windows.Forms.MenuStrip mainMenuStrip;
                private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
                private System.Windows.Forms.ToolStripMenuItem saveDictionaryToolStripMenuItem;
                private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
                private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
                private System.Windows.Forms.SaveFileDialog saveDictionaryDialog;
                private System.Windows.Forms.ToolStripMenuItem saveTextToolStripMenuItem;
                private System.Windows.Forms.SaveFileDialog saveTextDialog;
                private System.Windows.Forms.TextBox simulationTextBox;
                private System.Windows.Forms.Button simulateButton;
                private System.Windows.Forms.TextBox sentencesNumberTextBox;
                private System.Windows.Forms.Label label1;
                private System.Windows.Forms.Label label2;
                private System.Windows.Forms.TextBox maxWordsPerSentenceTextBox;
        }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Engineer
Russian Federation Russian Federation
Highly skilled Engineer with 14 years of experience in academia, R&D and commercial product development supporting full software life-cycle from idea to implementation and further support. During my academic career I was able to succeed in MIT Computers in Cardiology 2006 international challenge, as a R&D and SW engineer gain CodeProject MVP, find algorithmic solutions to quickly resolve tough customer problems to pass product requirements in tight deadlines. My key areas of expertise involve Object-Oriented
Analysis and Design OOAD, OOP, machine learning, natural language processing, face recognition, computer vision and image processing, wavelet analysis, digital signal processing in cardiology.

Comments and Discussions