예제 #1
0
    // The GetDeclensions method will fill the table with the correct declensions
    // of the noun. First it will determine to which declension group a
    // given noun belongs to. Next, it will determine the declensions according
    // to its gender (if the gender modifies the declension, such as in the verbs
    // of the second declension).
    private void PostDeclensions(Noun word)
    {
        // Get the declensions

        string[,] declensions = word.GetDeclensions();
        // If the translated word has an irregular plural, use it to list the plural
        // translations
        // Check to see if the noun constitutes a proper noun.
        if (word.IsProperNoun)
        {
            NominativeSingular.Text = declensions[0, 0] + "<br/><i>" + word.Definition + "</i>";
            NominativePlural.Text   = declensions[0, 1] + "<br/><i> " + word.Definition + "</i>";

            GenitiveSingular.Text = declensions[1, 0] + "<br/><i>of " + word.Definition + "</i>";
            GenitivePlural.Text   = declensions[1, 1] + "<br/><i>of " + word.Definition + "</i>";

            DativeSingular.Text = declensions[2, 0] + "<br/><i>to/for " + word.Definition + "</i>";
            DativePlural.Text   = declensions[2, 1] + "<br/><i>to/for " + word.Definition + "</i>";

            AccusativeSingular.Text = declensions[3, 0] + "<br/><i>" + word.Definition + "</i>";
            AccusativePlural.Text   = declensions[3, 1] + "<br/><i>" + word.Definition + "</i>";

            AblativeSingular.Text = declensions[4, 0] + "<br/><i>by/with/in " + word.Definition + "</i>";
            AblativePlural.Text   = declensions[4, 1] + "<br/><i>by/with/in " + word.Definition + "</i>";

            VocativeSingular.Text = declensions[5, 0] + "<br/><i>" + word.Definition + "</i>";
            VocativePlural.Text   = declensions[5, 1] + "<br/><i>" + word.Definition + "</i>";
        }
        else
        {
            // If the word exists only in the plural form, do not fill any of the singular
            // table cells
            if (word.PluralOnly)
            {
                NominativeSingular.Text = "";
                NominativePlural.Text   = declensions[0, 1] + "<br/><i> (the) " + word.Plural + "</i>";

                GenitiveSingular.Text = "";
                GenitivePlural.Text   = declensions[1, 1] + "<br/><i>of (the) " + word.Plural + "</i>";

                DativeSingular.Text = "";
                DativePlural.Text   = declensions[2, 1] + "<br/><i>to/for the " + word.Definition + "</i>";

                AccusativeSingular.Text = "";
                AccusativePlural.Text   = declensions[3, 1] + "<br/><i>(the) " + word.Plural + "</i>";

                AblativeSingular.Text = "";
                AblativePlural.Text   = declensions[4, 1] + "<br/><i>by/with/in (the) " + word.Plural + "</i>";

                VocativeSingular.Text = "";
                VocativePlural.Text   = declensions[5, 1] + "<br/><i>" + word.Plural + "</i>";
            }
            else
            {
                NominativeSingular.Text = declensions[0, 0] + "<br/><i> a/the " + word.Definition + "</i>";
                NominativePlural.Text   = declensions[0, 1] + "<br/><i> (the) " + word.Plural + "</i>";

                GenitiveSingular.Text = declensions[1, 0] + "<br/><i>of a/the " + word.Definition + "</i>";
                GenitivePlural.Text   = declensions[1, 1] + "<br/><i>of (the) " + word.Plural + "</i>";

                DativeSingular.Text = declensions[2, 0] + "<br/><i>to/for a/the " + word.Definition + "</i>";
                DativePlural.Text   = declensions[2, 1] + "<br/><i>to/for the " + word.Plural + "</i>";

                AccusativeSingular.Text = declensions[3, 0] + "<br/><i> a/the " + word.Definition + "</i>";
                AccusativePlural.Text   = declensions[3, 1] + "<br/><i>(the) " + word.Plural + "</i>";

                AblativeSingular.Text = declensions[4, 0] + "<br/><i>by/with/in a/the " + word.Definition + "</i>";
                AblativePlural.Text   = declensions[4, 1] + "<br/><i>by/with/in (the) " + word.Plural + "</i>";

                VocativeSingular.Text = declensions[5, 0] + "<br/><i>" + word.Definition + "</i>";
                VocativePlural.Text   = declensions[5, 1] + "<br/><i>" + word.Plural + "</i>";
            }
        }
    }