Skip to content

LT-22417 Move HCSynthByGloss into the FLEx repo#716

Open
AndyBlack wants to merge 5 commits intomainfrom
LT22417b
Open

LT-22417 Move HCSynthByGloss into the FLEx repo#716
AndyBlack wants to merge 5 commits intomainfrom
LT22417b

Conversation

@AndyBlack
Copy link
Collaborator

@AndyBlack AndyBlack commented Feb 26, 2026

This is for LT-22417 (Move HCSynthByGlass into FLEx repo).

HCSynthByGloss contains three products that have been in production use by FLExTrans for some time now. The changes here moved what was in the GitHub repository at https://github.com/sillsdev/HCSynthByGloss to Src\Utilities. The products are:

GenerateHCConfigForFLExTrans.exe (create a file that can be given to Hermit Crab to sythesize analyses).
HCSynthByGloss.exe (a stand-alone executable that invokes Hermit Crab to synthesize analyses and produce corresponding word forms).
HCSynthByGlossDll.dll (a DLL version of HCSynthByGloss.exe).
HCsynthByGlossLib.dll contains common classes used by all three.

The HCSynthByGloss tools use two XSLT transforms that I added to Src\Transforms\Presentation. In order for these to be included in the ApplicationTransforms.dll, I added them to Build\Windows.targets.

There also is a ReadMe.txt file pointing to the soon-to-be-archived repository mentioned above in case some one needs to check its history.

Note that the code in that repository that is now in FLEx has never undergone a code review. Having said that, since it is in production use, I'm not expecting anyone to review every line in it.


This change is Reviewable

Change-Id: I0c648a6f773392b0897585ad40ff40c268794520
Change-Id: I27c5ba3793fbdbb663445441db5523de66e631cd
@jasonleenaylor
Copy link
Contributor

Src/Utilities/HCSynthByGloss/HCSynthByGlossLib/HcXmlTraceManager.cs line 463 at r1 (raw file):

							reasonElem.Add(new XElement("Environment", env));
						if (prefixEnv != null)
							reasonElem.Add(new XElement("Environment", env));

Shouldn't prefixEnv be added here instead of env, and suffixEnv in the below?

@jasonleenaylor
Copy link
Contributor

Src/Utilities/HCSynthByGloss/HCSynthByGlossLib/HcXmlTraceManager.cs line 463 at r1 (raw file):

Previously, jasonleenaylor (Jason Naylor) wrote…

Shouldn't prefixEnv be added here instead of env, and suffixEnv in the below?

(So as not to seem superhuman I should note I did not find this on my own but was trying out an AI code review tool)

Change-Id: Ic71b2064fafd5738d09a30e6c87e98e846cbc5d5
@github-actions
Copy link

github-actions bot commented Feb 27, 2026

NUnit Tests

    1 files  ±0      1 suites  ±0   6m 32s ⏱️ +27s
4 407 tests ±0  4 320 ✅ ±0  87 💤 ±0  0 ❌ ±0 
4 416 runs  ±0  4 329 ✅ ±0  87 💤 ±0  0 ❌ ±0 

Results for commit 55e7fdd. ± Comparison against base commit db65176.

♻️ This comment has been updated with latest results.

jasonleenaylor and others added 2 commits February 27, 2026 10:50
* The FieldWorks repository has test assembly info which we include
  here for consistency
Change-Id: Ie90f91042afb66b919c7b7dd11775b9024be1039
Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasonleenaylor reviewed 23 files and all commit messages, and made 7 comments.
Reviewable status: 23 of 40 files reviewed, 2 unresolved discussions (waiting on AndyBlack).


Src/Transforms/Presentation/HCSynthByGlossFormatHCTrace.xsl line 474 at r2 (raw file):

	// findPosX() and findPosY() are from http://www.quirksmode.org/js/findpos.html
	function findPosX(obj)
{

If we want developers to be able to review the javascript in this code we should try and get the indentation consistent.
It doesn't really matter in the transformed file. I wouldn't hold up the PR for this, but it could be a future improvement.


Src/Transforms/Presentation/HCSynthByGlossFormatHCTrace.xsl line 567 at r2 (raw file):

		{
			if (node.childNodes.item(0).nodeName == "IMG")
				var str = node.childNodes.item(0).src;

Huh, devin pointed this out and it is correct. If we get here and the nodeName isn't image this code will crash. Not sure if that happens in practice, might want to fix this later.


Src/Utilities/HCSynthByGloss/GenerateHCConfig4FLExTrans/ConsoleLogger.cs line 127 at r2 (raw file):

		}
	}
}

Would it make sense to have this and the ConsoleLogger in GenerateHCConfig share code? Maybe a public console logger class?


Src/Utilities/HCSynthByGloss/GenerateHCConfig4FLExTrans/HCLoaderForFLExTrans.cs line 29 at r2 (raw file):

{
	// This is basically the same as HCLoader from LexText.ParserCore
	// We redid the GetGloss method to use Apertium-style "glosses"

Maybe ripe for refactoring later to reduce duplicated code?

Code quote:

	// This is basically the same as HCLoader from LexText.ParserCore
	// We redid the GetGloss method to use Apertium-style "glosses"

Src/Utilities/HCSynthByGloss/GenerateHCConfig4FLExTrans/InvalidAffixProcessException.cs line 1 at r2 (raw file):

using System;

It feels like all these exceptions are also copied from ParserCore. Could be we want to refactor for reuse.


Src/Utilities/HCSynthByGloss/GenerateHCConfig4FLExTrans/Properties/AssemblyInfo.cs line 1 at r2 (raw file):

// Copyright (c) 2023-2026 SIL International

We should be using the CommonAssemblyInfo, we want all the assemblies we ship with FieldWorks to do that.
We would remove this file and add a link in the .csproj similar to this:
<Compile Include="..\..\CommonAssemblyInfo.cs"> <Link>Properties\CommonAssemblyInfo.cs</Link> </Compile>


Src/Utilities/HCSynthByGloss/HCSynthByGloss/Properties/AssemblyInfo.cs line 1 at r2 (raw file):

// Copyright (c) 2023-2026 SIL International

Same here as my comment on the other AssemblyInfo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants