Skip to content

Commit dfe7b4e

Browse files
authored
Lt22416 Move Allomorph generator into the FLEx repo (#755)
* LT-22416 Move Allomorph generator into the FLEx repo Change-Id: I70f93af7e651186bd5e191cae2a795678c20dd29 * LT-22416: Most of the fixes suggested by devin.ai Change-Id: I44aa279a31c5eed4fdd184cfb69ac9c2d34115fa * LT-22416: Include the 8 csproj files in FieldWorks.sln Change-Id: Idb228cfaff284cc6b5c8a8c97ab398360192cd2d
1 parent 7a2b63c commit dfe7b4e

134 files changed

Lines changed: 523902 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

FieldWorks.sln

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,22 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HCSynthByGlossDllTest", "Sr
246246
EndProject
247247
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HCSynthByGlossTest", "Src\Utilities\HCSynthByGloss\HCSynthByGloss\HCSynthByGlossTest\HCSynthByGlossTest.csproj", "{5DB1CEDA-B7AA-4594-9CE0-6D3A6F5763DF}"
248248
EndProject
249+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AlloGenModel", "Src\Utilities\AlloVarGen\AlloGenModel\AlloGenModel.csproj", "{996498A3-06F1-4B1B-B83F-15648DD8F514}"
250+
EndProject
251+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AlloGenService", "Src\Utilities\AlloVarGen\AlloGenService\AlloGenService.csproj", "{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}"
252+
EndProject
253+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AlloGenModelTests", "Src\Utilities\AlloVarGen\AlloGenModel\AlloGenModelTests\AlloGenModelTests.csproj", "{98A04BE3-5CDA-4616-9396-E40B33CC9256}"
254+
EndProject
255+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AlloGenServiceTests", "Src\Utilities\AlloVarGen\AlloGenService\AlloGenServiceTests\AlloGenServiceTests.csproj", "{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}"
256+
EndProject
257+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AllomorphGeneratorDll", "Src\Utilities\AlloVarGen\AllomorphGeneratorDll\AllomorphGeneratorDll.csproj", "{2C57CEB5-40DE-4229-89B8-BADE30687815}"
258+
EndProject
259+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VarGenService", "Src\Utilities\AlloVarGen\VarGenService\VarGenService.csproj", "{0EDB239B-A523-4259-9123-EBA3B7E0139F}"
260+
EndProject
261+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VarGenServiceTest", "Src\Utilities\AlloVarGen\VarGenService\VarGenServiceTest\VarGenServiceTest.csproj", "{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}"
262+
EndProject
263+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VariantGeneratorDll", "Src\Utilities\AlloVarGen\VariantGeneratorDll\VariantGeneratorDll.csproj", "{91219E68-FF1D-4DED-BB06-3A6AF46C0419}"
264+
EndProject
249265
Global
250266
GlobalSection(SolutionConfigurationPlatforms) = preSolution
251267
Bounds|x64 = Bounds|x64
@@ -973,6 +989,54 @@ Global
973989
{5DB1CEDA-B7AA-4594-9CE0-6D3A6F5763DF}.Debug|x64.Build.0 = Debug|x64
974990
{5DB1CEDA-B7AA-4594-9CE0-6D3A6F5763DF}.Release|x64.ActiveCfg = Release|x64
975991
{5DB1CEDA-B7AA-4594-9CE0-6D3A6F5763DF}.Release|x64.Build.0 = Release|x64
992+
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Bounds|x64.ActiveCfg = Debug|x64
993+
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Bounds|x64.Build.0 = Debug|x64
994+
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Debug|x64.ActiveCfg = Debug|x64
995+
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Debug|x64.Build.0 = Debug|x64
996+
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Release|x64.ActiveCfg = Release|x64
997+
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Release|x64.Build.0 = Release|x64
998+
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Bounds|x64.ActiveCfg = Debug|x64
999+
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Bounds|x64.Build.0 = Debug|x64
1000+
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Debug|x64.ActiveCfg = Debug|x64
1001+
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Debug|x64.Build.0 = Debug|x64
1002+
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Release|x64.ActiveCfg = Release|x64
1003+
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Release|x64.Build.0 = Release|x64
1004+
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Bounds|x64.ActiveCfg = Debug|x64
1005+
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Bounds|x64.Build.0 = Debug|x64
1006+
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Debug|x64.ActiveCfg = Debug|x64
1007+
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Debug|x64.Build.0 = Debug|x64
1008+
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Release|x64.ActiveCfg = Release|x64
1009+
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Release|x64.Build.0 = Release|x64
1010+
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Bounds|x64.ActiveCfg = Debug|x64
1011+
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Bounds|x64.Build.0 = Debug|x64
1012+
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Debug|x64.ActiveCfg = Debug|x64
1013+
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Debug|x64.Build.0 = Debug|x64
1014+
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Release|x64.ActiveCfg = Release|x64
1015+
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Release|x64.Build.0 = Release|x64
1016+
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Bounds|x64.ActiveCfg = Debug|x64
1017+
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Bounds|x64.Build.0 = Debug|x64
1018+
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Debug|x64.ActiveCfg = Debug|x64
1019+
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Debug|x64.Build.0 = Debug|x64
1020+
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Release|x64.ActiveCfg = Release|x64
1021+
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Release|x64.Build.0 = Release|x64
1022+
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Bounds|x64.ActiveCfg = Debug|x64
1023+
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Bounds|x64.Build.0 = Debug|x64
1024+
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Debug|x64.ActiveCfg = Debug|x64
1025+
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Debug|x64.Build.0 = Debug|x64
1026+
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Release|x64.ActiveCfg = Release|x64
1027+
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Release|x64.Build.0 = Release|x64
1028+
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Bounds|x64.ActiveCfg = Debug|x64
1029+
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Bounds|x64.Build.0 = Debug|x64
1030+
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Debug|x64.ActiveCfg = Debug|x64
1031+
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Debug|x64.Build.0 = Debug|x64
1032+
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Release|x64.ActiveCfg = Release|x64
1033+
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Release|x64.Build.0 = Release|x64
1034+
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Bounds|x64.ActiveCfg = Debug|x64
1035+
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Bounds|x64.Build.0 = Debug|x64
1036+
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Debug|x64.ActiveCfg = Debug|x64
1037+
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Debug|x64.Build.0 = Debug|x64
1038+
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Release|x64.ActiveCfg = Release|x64
1039+
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Release|x64.Build.0 = Release|x64
9761040
EndGlobalSection
9771041
GlobalSection(SolutionProperties) = preSolution
9781042
HideSolutionNode = FALSE
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
// Copyright (c) 2022-2023 SIL International
2+
// This software is licensed under the LGPL, version 2.1 or later
3+
// (http://www.gnu.org/licenses/lgpl-2.1.html)
4+
5+
using System;
6+
using System.Collections.Generic;
7+
using System.Linq;
8+
using System.Text;
9+
using System.Threading.Tasks;
10+
11+
namespace SIL.AlloGenModel
12+
{
13+
public class Action
14+
{
15+
public List<string> ReplaceOpRefs { get; set; }
16+
17+
// Environments and StemName used in Allomorph Generator
18+
public List<Environment> Environments { get; set; }
19+
public StemName StemName { get; set; } = new StemName();
20+
21+
// Variant Types, ShowInMinorEntry, and PublishEntryIn used in Variant Generator
22+
public List<VariantType> VariantTypes { get; set; }
23+
public bool ShowMinorEntry { get; set; } = true;
24+
public List<PublishEntryInItem> PublishEntryInItems { get; set; } = new List<PublishEntryInItem>();
25+
26+
public Action()
27+
{
28+
ReplaceOpRefs = new List<string>();
29+
Environments = new List<Environment>();
30+
VariantTypes = new List<VariantType>();
31+
}
32+
33+
public Action Duplicate()
34+
{
35+
Action newAction = new Action();
36+
List<string> newReplaceOpRefs = new List<string>();
37+
foreach (string repRef in ReplaceOpRefs)
38+
{
39+
newReplaceOpRefs.Add(repRef);
40+
}
41+
newAction.ReplaceOpRefs = newReplaceOpRefs;
42+
List<Environment> newEnvironments = new List<Environment>();
43+
foreach (Environment env in Environments)
44+
{
45+
var newEnv = new Environment();
46+
newEnv.Active = env.Active;
47+
newEnv.Guid = env.Guid;
48+
newEnv.Name = env.Name;
49+
newEnvironments.Add(newEnv);
50+
}
51+
newAction.Environments = newEnvironments;
52+
var newSN = new StemName();
53+
newSN.Active = StemName.Active;
54+
newSN.Guid = StemName.Guid;
55+
newSN.Name = StemName.Name;
56+
newAction.StemName = newSN;
57+
List<VariantType> newVariantTypes = new List<VariantType>();
58+
foreach (VariantType vt in VariantTypes)
59+
{
60+
var newVT = new VariantType();
61+
newVT.Active = vt.Active;
62+
newVT.Guid = vt.Guid;
63+
newVT.Name = vt.Name;
64+
newVariantTypes.Add(newVT);
65+
}
66+
newAction.VariantTypes = newVariantTypes;
67+
newAction.ShowMinorEntry = ShowMinorEntry;
68+
List<PublishEntryInItem> newPublishEntryIn = new List<PublishEntryInItem>();
69+
foreach (PublishEntryInItem pubItem in PublishEntryInItems)
70+
{
71+
var newPubItem = new PublishEntryInItem();
72+
newPubItem.Active = pubItem.Active;
73+
newPubItem.Guid = pubItem.Guid;
74+
newPubItem.Name = pubItem.Name;
75+
newPublishEntryIn.Add(newPubItem);
76+
}
77+
newAction.PublishEntryInItems = newPublishEntryIn;
78+
return newAction;
79+
}
80+
81+
public override bool Equals(Object obj)
82+
{
83+
//Check for null and compare run-time types.
84+
if ((obj == null) || !this.GetType().Equals(obj.GetType()))
85+
{
86+
return false;
87+
}
88+
else
89+
{
90+
Action act = (Action)obj;
91+
return (ReplaceOpRefs.SequenceEqual(act.ReplaceOpRefs))
92+
&& (Environments.SequenceEqual(act.Environments))
93+
&& (VariantTypes.SequenceEqual(act.VariantTypes))
94+
&& (PublishEntryInItems.SequenceEqual(act.PublishEntryInItems))
95+
&& (StemName.Equals(act.StemName))
96+
&& (ShowMinorEntry == act.ShowMinorEntry);
97+
}
98+
}
99+
100+
public override int GetHashCode()
101+
{
102+
return Tuple
103+
.Create(
104+
ReplaceOpRefs,
105+
Environments,
106+
StemName,
107+
VariantTypes,
108+
ShowMinorEntry,
109+
PublishEntryInItems
110+
)
111+
.GetHashCode();
112+
}
113+
}
114+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright (c) 2022 SIL International
2+
// This software is licensed under the LGPL, version 2.1 or later
3+
// (http://www.gnu.org/licenses/lgpl-2.1.html)
4+
5+
using System;
6+
using System.Collections.Generic;
7+
using System.Linq;
8+
using System.Text;
9+
using System.Threading.Tasks;
10+
using System.Xml.Serialization;
11+
12+
namespace SIL.AlloGenModel
13+
{
14+
abstract public class AlloGenBase
15+
{
16+
[XmlAttribute("active")]
17+
public bool Active { get; set; } = true;
18+
19+
public override bool Equals(Object obj)
20+
{
21+
//Check for null and compare run-time types.
22+
if ((obj == null) || !this.GetType().Equals(obj.GetType()))
23+
return false;
24+
else
25+
{
26+
AlloGenBase agb = (AlloGenBase)obj;
27+
return (Active == agb.Active);
28+
}
29+
}
30+
31+
public override int GetHashCode()
32+
{
33+
return Active.GetHashCode();
34+
}
35+
}
36+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright (c) 2022-2023 SIL International
2+
// This software is licensed under the LGPL, version 2.1 or later
3+
// (http://www.gnu.org/licenses/lgpl-2.1.html)
4+
5+
using System;
6+
using System.Collections.Generic;
7+
using System.Linq;
8+
using System.Text;
9+
using System.Threading.Tasks;
10+
using System.Xml.Serialization;
11+
12+
namespace SIL.AlloGenModel
13+
{
14+
abstract public class AlloGenGuid : AlloGenBase
15+
{
16+
[XmlAttribute("guid")]
17+
public string Guid { get; set; } = "";
18+
public string Name { get; set; } = "";
19+
20+
override public string ToString()
21+
{
22+
return Name;
23+
}
24+
25+
public override bool Equals(Object obj)
26+
{
27+
if (!base.Equals(obj))
28+
return false;
29+
30+
//Check for null and compare run-time types.
31+
if ((obj == null) || !this.GetType().Equals(obj.GetType()))
32+
return false;
33+
else
34+
{
35+
AlloGenGuid agg = (AlloGenGuid)obj;
36+
return (Guid == agg.Guid) && (Name == agg.Name);
37+
}
38+
}
39+
40+
public override int GetHashCode()
41+
{
42+
int result = base.GetHashCode();
43+
return result + Tuple.Create(Guid, Name).GetHashCode();
44+
}
45+
}
46+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk">
3+
<PropertyGroup>
4+
<AssemblyName>AlloGenModel</AssemblyName>
5+
<RootNamespace>SIL.AlloGenModel</RootNamespace>
6+
<TargetFramework>net48</TargetFramework>
7+
<OutputType>Library</OutputType> <NoWarn>168,169,219,414,649,1635,1702,1701</NoWarn>
8+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
9+
<Prefer32Bit>false</Prefer32Bit>
10+
</PropertyGroup>
11+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
12+
<DefineConstants>DEBUG;TRACE</DefineConstants>
13+
<DebugSymbols>true</DebugSymbols>
14+
<Optimize>false</Optimize>
15+
<DebugType>portable</DebugType>
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
18+
<DefineConstants>TRACE</DefineConstants>
19+
<DebugSymbols>true</DebugSymbols>
20+
<Optimize>true</Optimize>
21+
<DebugType>portable</DebugType>
22+
</PropertyGroup>
23+
<ItemGroup>
24+
<PackageReference Include="Newtonsoft.Json" />
25+
<PackageReference Include="SIL.Core" />
26+
<PackageReference Include="System.ValueTuple" />
27+
</ItemGroup>
28+
<ItemGroup>
29+
<Reference Include="netstandard" />
30+
<Reference Include="System.Xml.Linq" />
31+
</ItemGroup>
32+
<ItemGroup>
33+
<ProjectReference Include="../../../Common/Filters/Filters.csproj" />
34+
<ProjectReference Include="../../../Common/FwUtils/FwUtils.csproj" />
35+
<ProjectReference Include="../../XMLUtils/XMLUtils.csproj" />
36+
</ItemGroup>
37+
<ItemGroup>
38+
<Compile Remove="AlloGenModelTests\**" />
39+
<EmbeddedResource Remove="AlloGenModelTests\**" />
40+
<None Remove="AlloGenModelTests\**" />
41+
<Compile Include="..\..\..\CommonAssemblyInfo.cs">
42+
<Link>Properties\CommonAssemblyInfo.cs</Link>
43+
</Compile>
44+
</ItemGroup>
45+
</Project>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk">
3+
<PropertyGroup>
4+
<AssemblyName>AlloGenModelTests</AssemblyName>
5+
<RootNamespace>AlloGenModelTests</RootNamespace>
6+
<TargetFramework>net48</TargetFramework>
7+
<OutputType>Library</OutputType>
8+
<IsTestProject>true</IsTestProject>
9+
<NoWarn>168,169,219,414,649,1635,1702,1701</NoWarn>
10+
<UseUiIndependentTestAssemblyInfo>true</UseUiIndependentTestAssemblyInfo>
11+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
12+
<Prefer32Bit>false</Prefer32Bit>
13+
</PropertyGroup>
14+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
15+
<DefineConstants>DEBUG;TRACE</DefineConstants>
16+
<DebugSymbols>true</DebugSymbols>
17+
<Optimize>false</Optimize>
18+
<DebugType>portable</DebugType>
19+
</PropertyGroup>
20+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
21+
<DefineConstants>TRACE</DefineConstants>
22+
<DebugSymbols>true</DebugSymbols>
23+
<Optimize>true</Optimize>
24+
<DebugType>portable</DebugType>
25+
</PropertyGroup>
26+
<ItemGroup>
27+
<PackageReference Include="Newtonsoft.Json" />
28+
<PackageReference Include="SIL.Core" />
29+
</ItemGroup>
30+
<ItemGroup>
31+
<PackageReference Include="SIL.LCModel.Core.Tests" PrivateAssets="All" />
32+
<PackageReference Include="SIL.LCModel.Utils.Tests" PrivateAssets="All" />
33+
<PackageReference Include="SIL.TestUtilities" />
34+
</ItemGroup>
35+
<ItemGroup>
36+
<Reference Include="netstandard" />
37+
</ItemGroup>
38+
<ItemGroup>
39+
<ProjectReference Include="..\AlloGenModel.csproj" />
40+
<ProjectReference Include="..\..\AlloGenService\AlloGenService.csproj" />
41+
<ProjectReference Include="..\..\..\..\Common\FwUtils\FwUtilsTests\FwUtilsTests.csproj" />
42+
</ItemGroup>
43+
<ItemGroup>
44+
<Compile Include="..\..\..\..\CommonAssemblyInfo.cs">
45+
<Link>Properties\CommonAssemblyInfo.cs</Link>
46+
</Compile>
47+
</ItemGroup>
48+
</Project>

0 commit comments

Comments
 (0)