From a41e6e31cb6e35348016e33352c8d8e53baf2145 Mon Sep 17 00:00:00 2001 From: Enkidu93 Date: Wed, 27 Nov 2024 10:38:49 -0500 Subject: [PATCH] Sort kbts --- src/SIL.Machine/Corpora/ParatextProjectTermsParserBase.cs | 3 ++- .../Corpora/ParatextProjectTermsParserTests.cs | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SIL.Machine/Corpora/ParatextProjectTermsParserBase.cs b/src/SIL.Machine/Corpora/ParatextProjectTermsParserBase.cs index b58ce3c6..0ae235a2 100644 --- a/src/SIL.Machine/Corpora/ParatextProjectTermsParserBase.cs +++ b/src/SIL.Machine/Corpora/ParatextProjectTermsParserBase.cs @@ -168,7 +168,8 @@ protected ParatextProjectTermsParserBase(ParatextProjectSettingsParserBase setti { return termsRenderings .Concat(termsGlosses.Where(kvp => !termsRenderings.ContainsKey(kvp.Key))) - .Select(kvp => (kvp.Key, (IReadOnlyList)kvp.Value.ToList())); + .Select(kvp => (kvp.Key, (IReadOnlyList)kvp.Value.ToList())) + .OrderBy(glosses => glosses.Key); } return new List<(string, IReadOnlyList)>(); } diff --git a/tests/SIL.Machine.Tests/Corpora/ParatextProjectTermsParserTests.cs b/tests/SIL.Machine.Tests/Corpora/ParatextProjectTermsParserTests.cs index 54034b9e..41da90b1 100644 --- a/tests/SIL.Machine.Tests/Corpora/ParatextProjectTermsParserTests.cs +++ b/tests/SIL.Machine.Tests/Corpora/ParatextProjectTermsParserTests.cs @@ -55,7 +55,7 @@ public void TestGetKeyTermsFromTermsLocalizations_NoTermRenderings() ); IEnumerable<(string TermId, IReadOnlyList Glosses)> terms = env.GetGlosses(); Assert.That(terms.Count, Is.EqualTo(5726)); - Assert.That(string.Join(" ", terms.First().Glosses), Is.EqualTo("Abagtha")); + Assert.That(string.Join(" ", terms.First().Glosses), Is.EqualTo("Aaron")); } [Test] @@ -139,8 +139,7 @@ public void TestGetKeyTermsFromTermsLocalizations_TermRenderingsExists_PreferLoc ); IReadOnlyList<(string TermId, IReadOnlyList Glosses)> terms = env.GetGlosses().ToList(); Assert.That(terms.Count, Is.EqualTo(5726)); - Assert.That(string.Join(" ", terms[1].Glosses), Is.EqualTo("Abagtha")); - Assert.That(string.Join(" ", terms[2].Glosses), Is.EqualTo("Abi")); + Assert.That(string.Join(" ", terms[1].Glosses), Is.EqualTo("Aaron")); } [Test]