Skip to content

Commit

Permalink
3303 tags
Browse files Browse the repository at this point in the history
  • Loading branch information
lavedon committed Jun 8, 2021
1 parent 3f8169e commit d5c3013
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 3 deletions.
11 changes: 9 additions & 2 deletions API.cs
Original file line number Diff line number Diff line change
Expand Up @@ -397,14 +397,21 @@ public static void APICalls(CurrentQuery query)
while (eLanguage.MoveNext())
{
var eLangCurrent = eLanguage.Current;
tempDefinition.DefinitionEtymology.EtymonLanguage.Add(eLangCurrent.ToString());
for (int ei = 0; ei < eLangCurrent.GetArrayLength(); ei++)
{
tempDefinition.DefinitionEtymology.EtymonLanguage.Add(eLangCurrent[ei].ToString());
}
}

var sourceLanguage = etymologyObject.GetProperty("source_language").EnumerateArray();
while (sourceLanguage.MoveNext())
{
var sourceLangCurrent = sourceLanguage.Current;
tempDefinition.DefinitionEtymology.EtymonLanguage.Add(sourceLangCurrent.ToString());
for (int ei = 0; ei < sourceLangCurrent.GetArrayLength(); ei++)
{
tempDefinition.DefinitionEtymology.SourceLanguage.Add(sourceLangCurrent[ei].ToString());

}
}

tempDefinition.DefinitionEtymology.EtymologySummary = etymologyObject.GetProperty("etymology_summary").ToString();
Expand Down
31 changes: 30 additions & 1 deletion ConsoleUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,35 @@ static void showEtymology(CurrentQuery query)
{
for (int i = 0; i < query.Definitions.Count; i++)
{

int dNum = i + 1;
Console.WriteLine($"Etymology for Definition #{dNum}: {query.Definitions[i].WordDefinition}");
Console.WriteLine();
Console.WriteLine(query.Definitions[i].DefinitionEtymology.EtymologySummary);
Console.WriteLine($"Etymology type: {query.Definitions[i].DefinitionEtymology.EtymologyType}.");
Console.WriteLine($"Etymology language: ");
foreach (var eLang in query.Definitions[i].DefinitionEtymology.EtymonLanguage)
{
Console.Write(eLang +" ");
}
Console.WriteLine();

if (query.Definitions[i].DefinitionEtymology.Etymons.Count == 0)
{
Console.WriteLine("No etymons are listed.");
} else {
Console.WriteLine("Etymons: ");
foreach (var etymon in query.Definitions[i].DefinitionEtymology.Etymons)
Console.Write(etymon + " ");
}
Console.WriteLine();
Console.WriteLine("Source languages:");
foreach (var s in query.Definitions[i].DefinitionEtymology.SourceLanguage)
{
Console.Write(s + " ");
}
Console.WriteLine();
Console.WriteLine();

}
}

Expand Down Expand Up @@ -163,6 +191,7 @@ public static void MainMenu(CurrentQuery query)

case ("e" or "etymology" or "etymons"):
Trace.WriteLine("Show etymology selected");
showEtymology(query);
break;

case ("l" or "lammatize"):
Expand Down
Binary file modified bin/Debug/net5.0/OxfordV2.dll
Binary file not shown.
Binary file modified bin/Debug/net5.0/OxfordV2.pdb
Binary file not shown.
Binary file modified obj/Debug/net5.0/OxfordV2.dll
Binary file not shown.
Binary file modified obj/Debug/net5.0/OxfordV2.pdb
Binary file not shown.

0 comments on commit d5c3013

Please sign in to comment.