-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform2- eng-mal dictionary.txt
163 lines (139 loc) · 4.2 KB
/
form2- eng-mal dictionary.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data.OleDb;
using System.IO;
namespace Aksharam
{
public partial class Form2 : Form
{
DatBase c = new DatBase();
int i=0;
char[] sep = new char[] { '.', ' ', ':', ';', '!', '*', '(', ')', '_', '+', ',', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '<', '>', '=', '-', '?', '\n','\t','\'','"' };
string s;
string p;
string k = "";
int l, li = 0, si;
public string rword;
public string nword;
public string delim;
public string data;
public bool more = true;
public Form2()
{
InitializeComponent();
}
StreamReader sr = new StreamReader(@"dict\dict.dic", Encoding.Default);
string[] tokens = new string[] { };
string line;
public string getTokens(string data)
{
string newmword = null;
sr.BaseStream.Seek(0, SeekOrigin.Begin);
while (!sr.EndOfStream)
{
line = sr.ReadLine();
tokens = line.Split(new char[] { ' ' }, StringSplitOptions.None);
if (tokens[0] == data)
{
newmword = tokens[1]; break;
}
}
return newmword;
}
public string show(string text)
{
string t;
c.connect();
c.cmd = new SqlCommand("select english,malayalam from dict where english=@eng", c.con);
c.cmd.Parameters.AddWithValue("@eng",text);
c.dr = c.cmd.ExecuteReader();
if (c.dr.Read())
{
t = c.dr[1].ToString();
if (text == "is")
{
rword = t;
}
}
else
{
t = "";
}
c.dr.Close();
if (delim == ".")
{
}
return t;
}
private void button1_Click(object sender, EventArgs e)
{
rt2.Clear();
data = rt1.Text;
while (more)
{
rt2.Text += getTokens(NextWord());
rt2.Text += delim;
} more = true;
}
public string NextWord()
{
string word = "";
int index = data.IndexOfAny(sep,0);
if (index != -1)
{
delim = data.Substring(index, 1);
word = data.Substring(0, index);
data = data.Substring(index + 1);
}
else
{
delim = "";
word = data.Substring(0);
data = "";
}
if (data.Length == 0)
{
more = false;
}
return word;
}
private void rt1_TextChanged(object sender, EventArgs e)
{
rt2.Clear();
data = rt1.Text.ToLower();
while (more)
{
rt2.Text += getTokens(NextWord());
rt2.Text += delim;
} more = true;
}
private void Form2_Load(object sender, EventArgs e)
{
rt1.TabIndex = 0;
rt1.TabStop = true;
rt1.Focus();
}
private void label3_Click(object sender, EventArgs e)
{
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
}
private void splitContainer1_SplitterMoved(object sender, SplitterEventArgs e)
{
}
private void rt2_TextChanged(object sender, EventArgs e)
{
}
private void Form2_FormClosed(object sender, FormClosedEventArgs e)
{
sr.Close();
}
}
}