Skip to content

Commit

Permalink
Merge branch 'release/9.1' into feature/writingSystemStyles
Browse files Browse the repository at this point in the history
  • Loading branch information
aror92 authored May 3, 2024
2 parents f120950 + 29defce commit fc9a4d9
Show file tree
Hide file tree
Showing 12 changed files with 236 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Build/mkall.targets
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
<ChorusNugetVersion>5.2.0-beta0003</ChorusNugetVersion>
<PalasoNugetVersion>13.0.0-beta0076</PalasoNugetVersion>
<ParatextNugetVersion>9.4.0.1-beta</ParatextNugetVersion>
<LcmNugetVersion>11.0.0-beta0087</LcmNugetVersion>
<LcmNugetVersion>11.0.0-beta0089</LcmNugetVersion>
<IcuNugetVersion>70.1.123</IcuNugetVersion>
<HermitCrabNugetVersion>2.5.13</HermitCrabNugetVersion>
<!--Todo: use PalasoBuildType, when it refers to somewhere that has the IPCFramework.-->
Expand Down
19 changes: 10 additions & 9 deletions Build/nuget-common/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<package id="NUnit" version="3.13.3" targetFramework="net45" />
<package id="NUnit.ConsoleRunner" version="3.12.0" targetFramework="net40" />
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.7.0" />
<package id="NUnit3TestAdapter" version="4.3.2" />
<package id="ParatextData" version="9.4.0.1-beta" targetFramework="net46"/>
<package id="protobuf-net" version="2.4.6" exclude="Build,Analyzers" />
<package id="Sandwych.QuickGraph.Core" version="1.0.0" />
Expand All @@ -51,15 +52,15 @@
<package id="SIL.Core" version="8.1.0-beta0035" targetFramework="net461" />
<package id="SIL.Core" version="13.0.0-beta0076" targetFramework="net461" />
<package id="SIL.DesktopAnalytics" version="4.0.0" targetFramework="net461" />
<package id="SIL.LCModel.Build.Tasks" version="11.0.0-beta0087" targetFramework="net461" />
<package id="SIL.LCModel.Core.Tests" version="11.0.0-beta0087" targetFramework="net461" />
<package id="SIL.LCModel.Core" version="11.0.0-beta0087" targetFramework="net461" />
<package id="SIL.LCModel.FixData" version="11.0.0-beta0087" targetFramework="net461" />
<package id="SIL.LCModel.Tests" version="11.0.0-beta0087" targetFramework="net461" />
<package id="SIL.LCModel.Tools" version="11.0.0-beta0087" targetFramework="net461" />
<package id="SIL.LCModel.Utils.Tests" version="11.0.0-beta0087" targetFramework="net461" />
<package id="SIL.LCModel.Utils" version="11.0.0-beta0087" targetFramework="net461" />
<package id="SIL.LCModel" version="11.0.0-beta0087" targetFramework="net461" />
<package id="SIL.LCModel.Build.Tasks" version="11.0.0-beta0089" targetFramework="net461" />
<package id="SIL.LCModel.Core.Tests" version="11.0.0-beta0089" targetFramework="net461" />
<package id="SIL.LCModel.Core" version="11.0.0-beta0089" targetFramework="net461" />
<package id="SIL.LCModel.FixData" version="11.0.0-beta0089" targetFramework="net461" />
<package id="SIL.LCModel.Tests" version="11.0.0-beta0089" targetFramework="net461" />
<package id="SIL.LCModel.Tools" version="11.0.0-beta0089" targetFramework="net461" />
<package id="SIL.LCModel.Utils.Tests" version="11.0.0-beta0089" targetFramework="net461" />
<package id="SIL.LCModel.Utils" version="11.0.0-beta0089" targetFramework="net461" />
<package id="SIL.LCModel" version="11.0.0-beta0089" targetFramework="net461" />
<package id="SIL.Lexicon" version="13.0.0-beta0076" targetFramework="net461" />
<package id="SIL.libpalaso.l10ns" version="6.0.0" targetFramework="net461" />
<package id="SIL.Lift" version="13.0.0-beta0076" targetFramework="net461" />
Expand Down
12 changes: 9 additions & 3 deletions Src/LexText/Interlinear/ChooseAnalysisHander.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ internal class ChooseAnalysisHandler : IComboHandler, IDisposable
{
int m_hvoAnalysis; // The current 'analysis', may be wordform, analysis, gloss.
int m_hvoSrc; // the object (CmAnnotation? or SbWordform) we're analyzing.
AnalysisOccurrence m_occurrence;
bool m_fInitializing = false; // true to suppress AnalysisChosen while setting up combo.
LcmCache m_cache;
IComboList m_combo;
Expand Down Expand Up @@ -110,12 +111,13 @@ internal IVwStylesheet StyleSheet
/// <param name="hvoSrc"></param>
/// <param name="?"></param>
/// <param name="comboList"></param>
public ChooseAnalysisHandler(LcmCache cache, int hvoSrc, int hvoAnalysis, IComboList comboList)
public ChooseAnalysisHandler(LcmCache cache, int hvoSrc, int hvoAnalysis, AnalysisOccurrence occurrence, IComboList comboList)
{
m_combo = comboList;
m_cache = cache;
m_hvoSrc = hvoSrc;
m_hvoAnalysis = hvoAnalysis;
m_occurrence = occurrence;
m_combo.SelectedIndexChanged += new EventHandler(m_combo_SelectedIndexChanged);
m_combo.WritingSystemFactory = cache.LanguageWritingSystemFactoryAccessor;
}
Expand Down Expand Up @@ -280,7 +282,9 @@ public void SetupCombo()
var wordform = m_owner.GetWordformOfAnalysis();

// Add the analyses, and recursively the other items.
foreach (var wa in wordform.AnalysesOC)
var guess_services = new AnalysisGuessServices(m_cache);
var sorted_analyses = guess_services.GetSortedAnalysisGuesses(wordform, m_occurrence, false);
foreach (var wa in sorted_analyses)
{
Opinions o = wa.GetAgentOpinion(
m_cache.LangProject.DefaultUserAgent);
Expand All @@ -307,7 +311,9 @@ void AddAnalysisItems(IWfiAnalysis wa)
{
AddItem(wa,
MakeAnalysisStringRep(wa, m_cache, StyleSheet != null, (m_owner as SandboxBase).RawWordformWs), true);
foreach (var gloss in wa.MeaningsOC)
var guess_services = new AnalysisGuessServices(m_cache);
var sorted_glosses = guess_services.GetSortedGlossGuesses(wa, m_occurrence);
foreach (var gloss in sorted_glosses)
{
AddItem(gloss, MakeGlossStringRep(gloss, m_cache, StyleSheet != null), true);
}
Expand Down
1 change: 1 addition & 0 deletions Src/LexText/Interlinear/ITextDllTests/ITextDllTests.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="Current">
<Import Project="..\..\..\..\packages\NUnit3TestAdapter.4.3.2\build\net35\NUnit3TestAdapter.props" />
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>9.0.21022</ProductVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,11 @@ public void ExportBasicInformation_FormSansMorph()
//validate export xml against schema
ValidateInterlinearXml(exportedDoc);

AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath($@"//word[item[@type='txt' and @lang='{QaaXKal}']='gone']", 1);
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath($@"//morph[item[@type='txt' and @lang='{QaaXKal}']]", 2);
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath($@"//morph[item[@type='txt' and @lang='{QaaXKal}']='go']", 1);
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath($@"//morph[item[@type='txt' and @lang='{QaaXKal}']='en']", 1);
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath($@"//word[item[@type='txt' and @lang='{QaaXKal}']='gone']", 1);
// The guesser adds an analysis for "go".
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath($@"//morph[item[@type='txt' and @lang='{QaaXKal}']='go']", 2);
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath($@"//morph[item[@type='txt' and @lang='{QaaXKal}']]", 3);
}

/// <summary>
Expand Down Expand Up @@ -448,7 +449,8 @@ public void ExportVariantTypeInformation_LT9374()
ValidateInterlinearXml(exportedDoc);
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath(@"//word[item[@type='txt']='went']", 1);
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath(@"//morph[item[@type='txt']='went']", 1);
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath(@"//morph[item[@type='cf']='go']", 1);
// The guesser adds an analysis for "go".
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath(@"//morph[item[@type='cf']='go']", 2);
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath(@"//morph/item[@type='variantTypes']", 1);
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath(@"//morph[item[@type='variantTypes']='+fr. var.']", 1);
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath(@"//morph[item[@type='gls']='go.PST']", 1);
Expand Down Expand Up @@ -597,7 +599,8 @@ public void ExportIrrInflVariantTypeInformation_LT7581_glsAppend()
ValidateInterlinearXml(exportedDoc);

AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath(@"//morph[item[@type='txt']='went']", 1);
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath(@"//morph[item[@type='cf']='go']", 1);
// The guesser adds an analysis for "go".
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath(@"//morph[item[@type='cf']='go']", 2);
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath(@"//morph[item[@type='gls']='glossgo']", 1);
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath(@"//morph/item[@type='glsAppend']", 1);
AssertThatXmlIn.Dom(exportedDoc).HasSpecifiedNumberOfMatchesForXpath(@"//morph[item[@type='glsAppend']='.pst']", 1);
Expand Down
11 changes: 8 additions & 3 deletions Src/LexText/Interlinear/SandboxBase.ComboHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ private static IComboHandler MakeCombo(IHelpTopicProvider helpTopicProvider,
ComboListBox clb2 = new ComboListBox();
clb2.StyleSheet = sandbox.StyleSheet;
ChooseAnalysisHandler caHandler = new ChooseAnalysisHandler(
caches.MainCache, hvoSbWord, sandbox.Analysis, clb2);
caches.MainCache, hvoSbWord, sandbox.Analysis, sandbox.m_occurrenceSelected, clb2);
caHandler.Owner = sandbox;
caHandler.AnalysisChosen += new EventHandler(
sandbox.Handle_AnalysisChosen);
Expand Down Expand Up @@ -1125,7 +1125,9 @@ private void AddAnalysesOf(IWfiWordform wordform, bool fBaseWordIsPhrase)
return; // no real wordform, can't have analyses.
ITsStrBldr builder = TsStringUtils.MakeStrBldr();
ITsString space = TsStringUtils.MakeString(fBaseWordIsPhrase ? " " : " ", m_wsVern);
foreach (IWfiAnalysis wa in wordform.AnalysesOC)
var guess_services = new AnalysisGuessServices(m_caches.MainCache);
var sorted_analyses = guess_services.GetSortedAnalysisGuesses(wordform, m_wsVern);
foreach (IWfiAnalysis wa in sorted_analyses)
{
Opinions o = wa.GetAgentOpinion(
m_caches.MainCache.LangProject.DefaultUserAgent);
Expand Down Expand Up @@ -3195,7 +3197,10 @@ public override void SetupCombo()
private void AddComboItems(ref int hvoEmptyGloss, ITsStrBldr tsb, IWfiAnalysis wa)
{
IList<int> wsids = m_sandbox.m_choices.EnabledWritingSystemsForFlid(InterlinLineChoices.kflidWordGloss);
foreach (IWfiGloss gloss in wa.MeaningsOC)

var guess_services = new AnalysisGuessServices(m_caches.MainCache);
var sorted_glosses = guess_services.GetSortedGlossGuesses(wa);
foreach (IWfiGloss gloss in sorted_glosses)
{
int glossCount = 0;

Expand Down
2 changes: 1 addition & 1 deletion Src/xWorks/ConfiguredLcmGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2940,7 +2940,7 @@ select match.Groups["rowcontents"] into rowContentsGroup
GenerateTableRow(usfm.GetSubstring(row.Item1, row.Item2), writer, config, settings, writingSystem);
}
settings.ContentGenerator.EndTableBody(writer);
settings.ContentGenerator.EndTable(writer);
settings.ContentGenerator.EndTable(writer, config);
writer.Flush();
}
return bldr;
Expand Down
2 changes: 1 addition & 1 deletion Src/xWorks/ILcmContentGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ IFragment GenerateGroupingNode(object field, string className, ConfigurableDicti
void AddTableCell(IFragmentWriter writer, bool isHead, int colSpan, HorizontalAlign alignment, IFragment content);
void EndTableRow(IFragmentWriter writer);
void EndTableBody(IFragmentWriter writer);
void EndTable(IFragmentWriter writer);
void EndTable(IFragmentWriter writer, ConfigurableDictionaryNode config);
void StartEntry(IFragmentWriter writer, ConfigurableDictionaryNode config, string className, Guid entryGuid, int index, RecordClerk clerk);
void AddEntryData(IFragmentWriter writer, List<ConfiguredLcmGenerator.ConfigFragment> pieces);
void EndEntry(IFragmentWriter writer);
Expand Down
2 changes: 1 addition & 1 deletion Src/xWorks/LcmJsonGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public void EndTableBody(IFragmentWriter writer)
// TODO: decide on a useful json representation for tables
}

public void EndTable(IFragmentWriter writer)
public void EndTable(IFragmentWriter writer, ConfigurableDictionaryNode config)
{
// TODO: decide on a useful json representation for tables
}
Expand Down
Loading

0 comments on commit fc9a4d9

Please sign in to comment.