Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to convert the paragraph into root words
    primarykey
    data
    text
    <p>excuse me, i'm trying to make simple application which converting the words into word. for example</p> <p>Enable = able Payment = Pay</p> <p>the text on my notepad was "enable payment"</p> <p>i'm using 2 sample words above, and i'm not getting what i need. i wrote "enable" and "payment" on notepad.txt. then the application will start and get the word.</p> <p>and the application will start trimming the words <em>cut the "En" and "ment"</em> so their result will be "able" and "pay"</p> <p>my application can trim the single word "enable" to "able" . and "payment" to "pay" but, the application didn't work well if i write 2 words or more such as "enable payment" or "payment enable"</p> <p>here is the user interface <a href="http://i1085.photobucket.com/albums/j423/Nencor_Theleftbehind/1.jpg" rel="nofollow">image</a></p> <p>and here is the source code,</p> <pre><code>using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; namespace KTM' { public partial class KTM : Form { public string notepad; public KTM() { InitializeComponent(); textBox1.Enabled=false; button2.Enabled = false; button3.Enabled = false; } void enable() { button2.Enabled = true; button3.Enabled = true; } private void button1_Click(object sender, EventArgs e) { string dir = Application.StartupPath.ToString(); OpenFileDialog fdlg = new OpenFileDialog(); fdlg.Title = "Open *txt files"; fdlg.InitialDirectory = @dir; fdlg.Filter = "Text files (*.txt)|*.txt|Text Files (*.txt)|*.txt"; fdlg.FilterIndex = 2; fdlg.RestoreDirectory = true; if (fdlg.ShowDialog() == DialogResult.OK) { textBox1.Text = fdlg.FileName; } else { } } private void textBox1_TextChanged(object sender, EventArgs e) { if (textBox1.Text.Equals("")) { } else { enable(); } } private void button2_Click(object sender, EventArgs e) { notepad = textBox1.Text; StreamReader sr = new StreamReader(notepad); string paragraf = sr.ReadToEnd(); sr.Close(); string[] kata = paragraf.Split(' '); int i = 0; //MessageBox.Show(kata[0]+" "+kata[1]+" "+kata[2]); foreach (string ambil in kata) { if (kata[i].StartsWith("en")) { kata[i] = kata[i].Substring(2); } if(kata[i].EndsWith("ment")) { int len = kata[i].Length; int kepake = len - 4; kata[i] = kata[i].Substring(0, kepake); } } i++; StreamWriter sw = new StreamWriter(notepad); i = 0; foreach (string ambil in kata) { sw.Write(kata[i]+" "); } i++; sw.Flush(); sw.Close(); MessageBox.Show("Converted and Saved ","KTM Stemming",MessageBoxButtons.OK,MessageBoxIcon.Information); } private void button3_Click(object sender, EventArgs e) { notepad = textBox1.Text; System.Diagnostics.Process.Start(notepad); } } </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload