Example #1
0
        static void FuncAnalyzeSentence()
        {
            OpenFileDialog openCorporasFileDialog = new OpenFileDialog();

            openCorporasFileDialog.Filter           = "xml files (*.xml)|*.xml|All files (*.*)|*.*";
            openCorporasFileDialog.RestoreDirectory = true;
            openCorporasFileDialog.Multiselect      = true;
            openCorporasFileDialog.Title            = "Please Select Corpora File(s)";
            List <string> lst_filepaths = new List <string>();

            if (openCorporasFileDialog.ShowDialog() == DialogResult.OK)
            {
                foreach (string str_path in openCorporasFileDialog.FileNames)
                {
                    lst_filepaths.Add(str_path);
                }
                List <Corpora> lst_cops = FuncDeserializeCorporaFiles(lst_filepaths);
                while (true)
                {
                    mLogger.Write("Please input a sentence: ");
                    string input_line = Console.ReadLine();
                    mLogger.WriteLine(input_line);
                    mLogger.WriteLine("");
                    string lang = CorpAnalyzer.AnalyzeTextFromCorporasWithDemandedOutput(lst_cops, input_line);
                    mLogger.Write("It is " + lang + " continue?(y/n)");
                    string inputed_command = Console.ReadLine();
                    mLogger.WriteLine(inputed_command);
                    mLogger.WriteLine("");
                    if ("n" == inputed_command)
                    {
                        break;
                    }
                }
            }
        }
Example #2
0
        static void CorporaIrrigationTest()
        {
            string[] arr_filenames = { @"E:\Dropbox\Codes Hub\C#\Corpus\text samples\english.txt", @"E:\Dropbox\Codes Hub\C#\Corpus\text samples\french.txt", @"E:\Dropbox\Codes Hub\C#\Corpus\text samples\italian.txt" };

            foreach (string filename in arr_filenames)
            {
                Corpora cops = CorpAnalyzer.ExtractCorporaFromFile(filename);
                SerializerTest(cops);
            }
        }
Example #3
0
        static void FuncBuildCorporas()
        {
            OpenFileDialog openTextFileDialog = new OpenFileDialog();

            openTextFileDialog.Filter           = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
            openTextFileDialog.RestoreDirectory = true;
            openTextFileDialog.Multiselect      = true;
            openTextFileDialog.Title            = "Please Select Text File(s)";
            List <Corpora> lst_cops = new List <Corpora>();

            if (openTextFileDialog.ShowDialog() == DialogResult.OK)
            {
                foreach (string str_path in openTextFileDialog.FileNames)
                {
                    Corpora cops = CorpAnalyzer.ExtractCorporaFromFile(str_path);
                    lst_cops.Add(cops);
                }
                FuncSerializeCorporaFiles(lst_cops);
            }
        }