예제 #1
0
        DataRow[] Select(string key)
        {
            if (key == null)
            {
                return(null);
            }

            var dividedParse = KoreanHelper.DivideJaso(key.Trim());

            DataRow[] dRows = resultSentence.Select($"Code LIKE '{dividedParse}' OR Code LIKE '{dividedParse}%'", "Count DESC");
            return(dRows);
        }
예제 #2
0
        int CheckOverlapDatarow(DataRow[] dRows, string ReadSentence)
        {
            int check = -1;

            for (int i = 0; i < dRows.Length; i++)
            {
                if (dRows[i]["Code"].ToString() == KoreanHelper.DivideJaso(ReadSentence))
                {
                    check = i;
                }
            }
            return(check);
        }
예제 #3
0
        void Add(string key)
        {
            Console.Write("Sentences Dataset path is " + DatasetPath + "\n");

            DataRow temp = resultSentence.NewRow();

            temp["Name"]  = key;
            temp["Code"]  = KoreanHelper.DivideJaso(key);
            temp["Count"] = 0;
            resultSentence.Rows.Add(temp);

            Console.Write(key + " has added in database! (" + DatasetPath + ")\n");
        }
예제 #4
0
        public void Save()
        {
            resultSentence.TableName = "Data";
            resultSentence.WriteXml(DatasetPath);
            resultSentence.Reset();
            resultSentence.Columns.Add(dc1);
            resultSentence.Columns.Add(dc2);
            resultSentence.Columns.Add(dc3);
            sentence.Reset();
            sentence = GetData(DatasetPath);

            foreach (DataRow dRow in sentence.Tables[0].Rows)
            {
                string s = KoreanHelper.DivideJaso(dRow["Name"].ToString());

                DataRow newRow = resultSentence.NewRow();

                newRow["Name"]  = dRow["Name"].ToString();
                newRow["Code"]  = dRow["Code"].ToString();
                newRow["Count"] = dRow["Count"].ToString();

                resultSentence.Rows.Add(newRow);
            }
        }