diff --git a/API.cs b/API.cs index 3f7943d..80fc321 100644 --- a/API.cs +++ b/API.cs @@ -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(); diff --git a/ConsoleUI.cs b/ConsoleUI.cs index 8952eb6..1640e76 100644 --- a/ConsoleUI.cs +++ b/ConsoleUI.cs @@ -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(); + } } @@ -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"): diff --git a/bin/Debug/net5.0/OxfordV2.dll b/bin/Debug/net5.0/OxfordV2.dll index 6ea6bdd..af25992 100644 Binary files a/bin/Debug/net5.0/OxfordV2.dll and b/bin/Debug/net5.0/OxfordV2.dll differ diff --git a/bin/Debug/net5.0/OxfordV2.pdb b/bin/Debug/net5.0/OxfordV2.pdb index 63fbd90..4a86bb3 100644 Binary files a/bin/Debug/net5.0/OxfordV2.pdb and b/bin/Debug/net5.0/OxfordV2.pdb differ diff --git a/obj/Debug/net5.0/OxfordV2.dll b/obj/Debug/net5.0/OxfordV2.dll index 6ea6bdd..af25992 100644 Binary files a/obj/Debug/net5.0/OxfordV2.dll and b/obj/Debug/net5.0/OxfordV2.dll differ diff --git a/obj/Debug/net5.0/OxfordV2.pdb b/obj/Debug/net5.0/OxfordV2.pdb index 63fbd90..4a86bb3 100644 Binary files a/obj/Debug/net5.0/OxfordV2.pdb and b/obj/Debug/net5.0/OxfordV2.pdb differ