Example #1
0
        public static void AinmfhocailRegex(string regex, string filenameEnding)
        {
            StreamWriter writer = new StreamWriter(@"E:\deleteme\ainmfhocail-" + filenameEnding + ".txt");

            writer.Write("fillteán" + "\t" + "leama" + "\t" + "inscne" + "\t" + "díochlaonadh mar atá" + "\t" + "díochlaonadh nua");
            writer.WriteLine();

            string[] folders = { "noun", "nounNew", "nounUnsafe" };
            foreach (string folder in folders)
            {
                foreach (string file in Directory.GetFiles(@"C:\MBM\Gramadan\BuNaMo\" + folder, "*.xml"))
                {
                    Console.WriteLine(file);
                    Noun n = new Noun(file);
                    if (Regex.IsMatch(n.getLemma(), regex))
                    {
                        writer.Write(folder + "\t" + n.getLemma() + "\t" + n.getGender().ToString().ToLower() + "\t" + n.declension);
                        writer.WriteLine();
                    }
                }
            }
            writer.Close();
        }
Example #2
0
        public static void AinmfhocailBearnai()
        {
            StreamWriter writer = new StreamWriter(@"E:\deleteme\ainmfhocail-bearnaí.txt");

            writer.Write("fillteán" + "\t" + "leama" + "\t" + "inscne" + "\t" + "díochlaonadh");
            writer.Write("\t" + "fadhb");
            writer.Write("\t" + "ginideach uatha");
            writer.Write("\t" + "ainmneach iolra");
            writer.Write("\t" + "ginideach iolra");
            writer.WriteLine();

            string[] folders = { "noun", "nounNew", "nounUnsafe" };
            foreach (string folder in folders)
            {
                foreach (string file in Directory.GetFiles(@"C:\MBM\Gramadan\BuNaMo\" + folder, "*.xml"))
                {
                    Console.WriteLine(file);
                    string problem = "";

                    Noun n = new Noun(file);
                    if (n.sgGen.Count == 0 && n.plNom.Count == 0 && n.plGen.Count == 0)
                    {
                        problem += ", gach foirm in easnamh";
                    }
                    else
                    {
                        if (n.sgNom.Count == 0 && n.sgGen.Count == 0)
                        {
                            problem += ", uatha in easnamh";
                        }
                        if (n.sgNom.Count == 0 && n.sgGen.Count != 0)
                        {
                            problem += ", ainmneach uatha in easnamh";
                        }
                        if (n.sgNom.Count != 0 && n.sgGen.Count == 0)
                        {
                            problem += ", ginideach uatha in easnamh";
                        }
                        if (n.plNom.Count == 0 && n.plGen.Count == 0)
                        {
                            problem += ", iolra in easnamh";
                        }
                        if (n.plNom.Count == 0 && n.plGen.Count != 0)
                        {
                            problem += ", ainmneach iolra in easnamh";
                        }
                        if (n.plNom.Count != 0 && n.plGen.Count == 0)
                        {
                            problem += ", ginideach iolra in easnamh";
                        }
                    }

                    if (problem.Length > 1)
                    {
                        problem = problem.Substring(2);
                    }
                    if (problem != "")
                    {
                        writer.Write(folder + "\t" + n.getLemma() + "\t" + n.getGender().ToString().ToLower() + "\t" + n.declension);
                        writer.Write("\t" + problem);
                        writer.Write("\t" + PrintForms(n.sgGen));
                        writer.Write("\t" + PrintForms(n.plNom));
                        writer.Write("\t" + PrintForms(n.plGen));
                        writer.WriteLine();
                    }
                }
            }
            writer.Close();
        }