using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Text.RegularExpressions;
namespace okumadeneme
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnOku_Click(object sender, EventArgs e)
{
for (int i = 1; i < 3; i++)
{
StreamReader sr = new StreamReader("c:\\" + i + ".txt");
rtbAl.Text += sr.ReadLine();
sr.Close();
}
string a = rtbAl.Text;
string[] nokta = a.Split('.');
for (int i = 0; i < nokta.Length; i++)
{
rtbOkunan.Text += nokta[i] + " " + "\n";
}
string b = rtbOkunan.Text;
string[] bosluk = b.Split(' ');
for (int i = 0; i < bosluk.Length-(nokta.Length-1); i++)
{
rtbOkunan.Text += "@attribute " + "\"" + bosluk[i] + "\"" + " integer" + "\n";
}
rtbOkunan.Text += "@data" + "\n";
int sayac = 0;
for (int i = 0; i < nokta.Length; i++)
{
for (int j = 0; j < bosluk.Length-(nokta.Length-1); j++)
{
MatchCollection kac = Regex.Matches(nokta[i], bosluk[j]);
sayac = kac.Count;
if (sayac != 0)
{
rtbOkunan.Text += (j+1) + " " + sayac + ",";
}
}
}
}
}
}
Good evening everyone I have a question,
for example my output should be like this I should write each word only once and keep their indexes and also count them but when I count them if 2 words are the same in a sentence it counts two and write it twice I want to write this also once. I started to code but I cannot fix these problems I will be glad if someone help me about this thank you .
@attribute "kaydirmazlik" integer
@attribute "tutabildigini" integer
@attribute "tozlanarak" integer
@attribute "kullanilacagindan" integer
@data
{0 1,1 1,2 1,3 2,4 1,5 1,6 1,7 1,8 1,9 1,10 1,11 1,12 1,13 1,14 1,15 1,16 1,17 1,18 1,19 1}
{0 0,14 1,93 1,94 1,95 1,96 1,97 1,98 1,99 1,100 1,101 1,102 1,103 1,104 1,105 1,106 1}
{0 1,2 1,3 1,24 1,31 1,107 1,108 1,109 1,110 1,111 1,112 1}
{0 0,186 1,187 1,188 1,189 1,190 1,191 1,192 1,193 1,194 1,195 1}
{0 1,24 1,73 1,129 1,196 1,197 1,198 1,199 1,200 1,201 1,202 1,203 1,204 1}