static void Main(string[] args) { LoadUlkeler(); LoadSehirler(); LoadIlceler(); LoadSemtMahalle(); var manager = new LuceneManager(); if (!manager.ExistSchema("address")) { manager.AddSchema("address"); } Console.WriteLine("Ülkeler indeksleniyor"); manager.Index("address", TableUlke); Console.WriteLine("Şehirler indeksleniyor"); manager.Index("address", TableSehirler); Console.WriteLine("İlceler indeksleniyor"); manager.Index("address", TableIlceler); Console.WriteLine("Semt mahalle indeksleniyor"); manager.Index("address", TableSemtMahalle); }
public override void Analyse(LineCollection lines) { if (lines == null) { return; } manager = new LuceneManager(); if (!manager.ExistSchema("address")) { manager.AddSchema("address"); } var analyzeIndexList = new List <AnalyzeIndex>(); foreach (var line in lines) { foreach (var sentence in line.SentenceList) { foreach (var word in sentence.WordList) { if (word.SpellWord != null) { if (word.SpellWord.Root != null) { var adresList = AddressControl(word); if (adresList != null) { if (adresList.Count > 0) { var analyze = new AnalyzeIndex(); analyze.AnalyzeIndexCollection.AddRange(adresList); analyze.LineNumber = lines.IndexOf(line); analyze.WordNumber = sentence.WordList.IndexOf(word); analyze.SentenceNumber = line.SentenceList.IndexOf(sentence); analyzeIndexList.Add(analyze); } } } } } } } ClearAddressIndex(ref analyzeIndexList, lines); }
static void Main(string[] args) { var manager = new LuceneManager(); if (!manager.ExistSchema("nlp")) { manager.AddSchema("nlp"); } var table = new DataTable("test"); table.Columns.Add("adi"); table.Columns.Add("soyadi"); var r1 = table.NewRow(); r1["adi"] = "dinçer"; r1["soyadi"] = "uygun"; var r2 = table.NewRow(); r2["adi"] = "lokman"; r2["soyadi"] = "çetin"; var r3 = table.NewRow(); r3["adi"] = "serkan"; r3["soyadi"] = "akın"; table.Rows.Add(r1); table.Rows.Add(r2); table.Rows.Add(r3); manager.Index("nlp", table); DataTable data = manager.GetAllDocument("nlp", "test"); }