string[] allPronouns = Pronouns.GetAll(); string[] allSingularPronouns = Pronouns.Singular.GetAll(); string SingularSubjectPronoun = Pronouns.Singular.Subject
It looks like using "tags" might be the way to go with this, rather than tables... so maybe
Pronouns.GetMatching("Singular", "subject");
I can't imagine what the best way is of doing this though...
Here was my first trial (with out doing anything 'fancy')
// singular pronouns
string[] pronounsSubjS = { "I", "you", "he", "she", "it", "we", "they" };
string[] pronounsObjS = { "me", "you", "him", "her", "it" };
string[] pronounsSubjOrObjS = { "you", "it" };
string[] pronounsReflexiveS = { "myself", "yourself", "himself", "herself", "itself" };
// plural pronouns
string[] pronounsSubjP = { "we", "you", "they" };
string[] pronounsObjP = { "us", "you", "them" };
string[] pronounsSecond = { "you" }; // this could be objective or subjective, and could be sigular or plural?
string[] pronounsSecondRefS = { "yourself" }; // this could be objective or subjective, and could be sigular or plural?
string[] pronounsSecondRefP = { "yourselves" }; // this could be objective or subjective, and could be sigular or plural?
string[] pronounsReflexiveP = { "ourselves", "yourselves", "themselves" };
Then I was like, "hey, why don't I put these guys into a class?" But now I see why, it's a bit odd...
// this is how I reference it in my code
Pronoun myPronouns = new Pronoun();
string[] tehString = myPronouns.singular.GetAll();
MessageBox.Show(tehString[8]); // this is just proof that tehString is an array filled with all the pronouns of the singular form (and there are repeats so, meh...)
public class Pronoun
{
public Pronoun.Singular singular = new Pronoun.Singular();
public class Singular
{
public Pronoun.Singular.Subject subject = new Pronoun.Singular.Subject();
public Pronoun.Singular.Object obj = new Pronoun.Singular.Object();
public Pronoun.Singular.Reflexive reflexive = new Pronoun.Singular.Reflexive();
public string[] GetAll()
{
ArrayList allEntities = new ArrayList();
allEntities.Add(subject.GetAll());
allEntities.Add(obj.GetAll());
allEntities.Add(reflexive.GetAll());
int newSize = 0; // find size to make the return array be
foreach (string[] entity in allEntities)
{
newSize += entity.GetUpperBound(0) + 1;
}
string[] all = new string[newSize];
int counter = 0; // combine the arrays
foreach (string[] entity in allEntities)
{
entity.CopyTo(all, counter);
counter += entity.GetUpperBound(0) + 1;
}
return all;
}
public class Subject
{
public string[] First = { "I" };
public string[] Second = { "you" };
public string[] Third = { "he", "she", "it" };
public string[] GetAll()
{
ArrayList allEntities = new ArrayList();
allEntities.Add(First);
allEntities.Add(Second);
allEntities.Add(Third);
int newSize = 0; // find size to make the return array be
foreach (string[] entity in allEntities)
{
newSize += entity.GetUpperBound(0) + 1;
}
string[] all = new string[newSize];
int counter = 0; // combine the arrays
foreach (string[] entity in allEntities)
{
entity.CopyTo(all, counter);
counter += entity.GetUpperBound(0) + 1;
}
return all;
}
}
public class Object
{
string[] First = { "me" };
string[] Second = { "you" };
string[] Third = { "him", "her", "it" };
public string[] GetAll()
{
ArrayList allEntities = new ArrayList();
allEntities.Add(First);
allEntities.Add(Second);
allEntities.Add(Third);
int newSize = 0; // find size to make the return array be
foreach (string[] entity in allEntities)
{
newSize += entity.GetUpperBound(0) + 1;
}
string[] all = new string[newSize];
int counter = 0; // combine the arrays
foreach (string[] entity in allEntities)
{
entity.CopyTo(all, counter);
counter += entity.GetUpperBound(0) + 1;
}
return all;
}
}
public class Reflexive
{
string[] First = { "myself" };
string[] Second = { "yourself" };
string[] Third = {"himself", "herself", "itself"};
public string[] GetAll()
{
ArrayList allEntities = new ArrayList();
allEntities.Add(First);
allEntities.Add(Second);
allEntities.Add(Third);
int newSize = 0; // find size to make the return array be
foreach (string[] entity in allEntities)
{
newSize += entity.GetUpperBound(0) + 1;
}
string[] all = new string[newSize];
int counter = 0; // combine the arrays
foreach (string[] entity in allEntities)
{
entity.CopyTo(all, counter);
counter += entity.GetUpperBound(0) + 1;
}
return all;
}
}
}
}
Yeah, it gets pretty long, lol. And I haven't even done the plural form pronouns (and this took a while...). So I gotta assume that there's a better, cleaner way to do this, so plz comment on my code and maybe throw some alternatives my way.
Oh, here's a visual reference I've been using about pronouns http://en.wikipedia...._modern_English

New Topic/Question
Reply




MultiQuote





|