コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: AnalyseAddress.cs プロジェクト: dinceruygun/NLP
        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);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: dinceruygun/NLP
        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");
        }