-
Notifications
You must be signed in to change notification settings - Fork 4
/
Program.cs
83 lines (72 loc) · 3.37 KB
/
Program.cs
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
/*
* Created by SharpDevelop.
* User: Gheyret Kenji
* Date: 2021/02/24
* Time: 10:32
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.IO;
using System.Collections.Generic;
namespace UyghurSpell
{
class Program
{
public static void Main(string[] args)
{
System.Diagnostics.Debug.WriteLine("Uyghurche Imla Tekshrush Programisi we uni Ishlitish!");
System.Diagnostics.Debug.WriteLine("Ekanda korushke qolay bolushi uchun Latinche halette sinaymiz");
UyghurSpell imla = new UyghurSpell();
String path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"uyghur_imla.txt");
imla.LoadDictionary("uyghur_imla.txt",Uyghur.YEZIQ.ULY);
System.Diagnostics.Debug.WriteLine("Imla ambiridiki soz sani :" + imla.WordCount);
string soz = "Uyghur";
string barmu = imla.IsListed(soz)?"Bar":"Yoq";
System.Diagnostics.Debug.WriteLine(soz + " Imla ambirida " + barmu);
System.Diagnostics.Debug.WriteLine("======================================");
//Barliq aqs din bashlanghan sozlerni izdep tapidu
soz = "aqs*";
List<string> namzatlar = imla.GetSuggestions(soz);
System.Diagnostics.Debug.WriteLine("bariq aqs bilen bashlanghan soz: " + soz);
foreach(string nam in namzatlar){
System.Diagnostics.Debug.WriteLine(nam);
}
System.Diagnostics.Debug.WriteLine("======================================");
soz = "z?w??"; //birinchi herp z, 3-herp w bolghan 5 herplik sozni izdep tapidu
System.Diagnostics.Debug.WriteLine("Birinchi herpi z, 3-herpi w bolghan 5 herplik soz: " + soz);
namzatlar = imla.GetSuggestions(soz);
foreach(string nam in namzatlar){
System.Diagnostics.Debug.WriteLine(nam);
}
System.Diagnostics.Debug.WriteLine("======================================");
soz = "a????mu"; // a bilen bashlanghan, axiri mu bilen axirlashqan 7 herplik sozni izdep tapidu
System.Diagnostics.Debug.WriteLine("a bilen bashlanghan, axiri mu bilen axirlashqan 7 herplik soz: " + soz);
namzatlar = imla.GetSuggestions(soz);
foreach(string nam in namzatlar){
System.Diagnostics.Debug.WriteLine(nam);
}
System.Diagnostics.Debug.WriteLine("======================================");
soz = "d??e*"; // a bilen bashlanghan, axiri mu bilen axirlashqan 7 herplik sozni izdep tapidu
System.Diagnostics.Debug.WriteLine("birnchi heripi d, 4-heripi e bolghan barliq sozler: " + soz);
namzatlar = imla.GetSuggestions(soz);
foreach(string nam in namzatlar){
System.Diagnostics.Debug.WriteLine(nam);
}
System.Diagnostics.Debug.WriteLine("======================================");
soz = "bugun";
namzatlar = imla.Lookup(soz); // bu yerde bugun degenni xata dep qarap, her xil ehtimaliqlarni kozde tutqan halda namzat sozlerni izdeydu
System.Diagnostics.Debug.WriteLine(soz + " ning namzatlirining sani : " + namzatlar.Count);
foreach(string nam in namzatlar){
System.Diagnostics.Debug.WriteLine(nam);
}
System.Diagnostics.Debug.WriteLine("======================================");
soz = "keldiya";
namzatlar = imla.Lookup(soz); // Xata sozning barliq namzatlirini izdep tapidu
System.Diagnostics.Debug.WriteLine(soz + " ning namzatlirining sani : " + namzatlar.Count);
foreach(string nam in namzatlar){
System.Diagnostics.Debug.WriteLine(nam);
}
}
}
}