Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ indent_style = tab
tab_width = 4

# Settings Visual Studio uses for generated files
[*.{csproj,resx,settings,vcxproj*,vdproj,xml,yml,config}]
[*.{csproj,resx,settings,vcxproj*,vdproj,xml,yml,config,props}]
indent_style = space
indent_size = 2

Expand Down
4 changes: 1 addition & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
<PackageProjectUrl>https://github.com/sillsdev/liblcm</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Platform>Any CPU</Platform>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<OutputPath>$(MSBuildThisFileDirectory)artifacts/$(Configuration)/$(TargetFramework)</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<PackageOutputPath>$(MSBuildThisFileDirectory)/artifacts</PackageOutputPath>
<SignAssembly>true</SignAssembly>
<WarningsAsErrors>NU1605;CS8002</WarningsAsErrors>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)/liblcm.snk</AssemblyOriginatorKeyFile>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand Down
1 change: 0 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"sdk": {
"version": "6.0.0",
"rollForward": "latestMajor"
}
}
Binary file removed liblcm.snk
Binary file not shown.
1 change: 0 additions & 1 deletion src/CSTools/Tools/Tools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<Description>SIL LCModel Lexer/Parser Tools</Description>
<PackageOutputPath>../../../artifacts</PackageOutputPath>
<ChangelogFile>../../../CHANGELOG.md</ChangelogFile>
<AssemblyOriginatorKeyFile>../../../liblcm.snk</AssemblyOriginatorKeyFile>
<DefineConstants>TRACE;GENTIME</DefineConstants>
<NoWarn>1701;1702;0162</NoWarn>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/CSTools/lg/lg.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<RootNamespace>SIL.LCModel.Tools</RootNamespace>
<Description>Lexer Generator</Description>
<PackageOutputPath>../../../artifacts</PackageOutputPath>
<AssemblyOriginatorKeyFile>../../../liblcm.snk</AssemblyOriginatorKeyFile>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<NoWarn>1701;1702;0162</NoWarn>
Expand Down
1 change: 0 additions & 1 deletion src/CSTools/pg/pg.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<RootNamespace>SIL.LCModel.Tools</RootNamespace>
<Description>Parser Generator</Description>
<PackageOutputPath>../../../artifacts</PackageOutputPath>
<AssemblyOriginatorKeyFile>../../../liblcm.snk</AssemblyOriginatorKeyFile>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<NoWarn>1701;1702;0162</NoWarn>
Expand Down
2 changes: 1 addition & 1 deletion src/SIL.LCModel.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("SIL.LCModel.Core.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b511304f05af0a01cbc5408cdbdf742aa1664db0e1157235bb2619e7fb5e705bd3534a7157a088a458ec3136e46ebd2b73519fb07dffd2daa40a7b9aa340675d926ab918d2e0183b8613320529b8a490028c8e1b40b980f3724928455d447d8f93d459be3c55a4e3f2ef5119c3393fd25adba301cbff8a3ffbce2e181d143788")]
[assembly: InternalsVisibleTo("SIL.LCModel.Core.Tests")]
8 changes: 2 additions & 6 deletions src/SIL.LCModel.Core/SIL.LCModel.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<RootNamespace>SIL.LCModel.Core</RootNamespace>
<Description>The liblcm library is the core FieldWorks model for linguistic analyses of languages. Tools in this library provide the ability to store and interact with language and culture data, including anthropological, text corpus, and linguistics data.
SIL.LCModel.Core provides a base library with core functionality.</Description>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand All @@ -15,13 +16,13 @@ SIL.LCModel.Core provides a base library with core functionality.</Description>
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="2.0.4" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.4" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="NHunspell" Version="1.2.5554.16953" GeneratePropertyPath="true" />
<PackageReference Include="SIL.Lexicon" Version="14.2.0-*" />
<PackageReference Include="SIL.ReleaseTasks" Version="2.5.0" PrivateAssets="All" />
<PackageReference Include="SIL.WritingSystems" Version="14.2.0-*" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
<PackageReference Include="vswhere" Version="2.8.4" PrivateAssets="all" />
<PackageReference Include="WeCantSpell.Hunspell" Version="6.0.0" />
<ProjectReference Include="..\CSTools\Tools\Tools.csproj" />
<ProjectReference Include="..\SIL.LCModel.Build.Tasks\SIL.LCModel.Build.Tasks.csproj" />
<ProjectReference Include="..\SIL.LCModel.Utils\SIL.LCModel.Utils.csproj" />
Expand Down Expand Up @@ -84,11 +85,6 @@ SIL.LCModel.Core provides a base library with core functionality.</Description>
<None Include="App.config" Pack="true" PackagePath="contentFiles\any\any\$(AssemblyTitle).dll.config" />
</ItemGroup>

<ItemGroup>
<None Include="$(PkgNHunspell)\content\Hunspellx64.dll" CopyToOutputDirectory="PreserveNewest" />
<None Include="$(PkgNHunspell)\content\Hunspellx86.dll" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<PropertyGroup>
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">obj/x86/$(Configuration)/</IntermediateOutputPath>
<MsBuildCommand Condition="'$(MsBuildRuntimeType)'=='Core' And '$(MsBuildCommand)'==''">dotnet build</MsBuildCommand>
Expand Down
29 changes: 3 additions & 26 deletions src/SIL.LCModel.Core/SpellChecking/SpellEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.IO;
using System.Text;
using Icu;
using SIL.PlatformUtilities;

namespace SIL.LCModel.Core.SpellChecking
{
Expand All @@ -26,11 +25,7 @@ internal static SpellEngine Create(string affixPath, string dictPath, string exc
SpellEngine spellEngine = null;
try
{
if (Platform.IsWindows)
spellEngine = CreateSpellEngineWindows(affixPath, dictPath, exceptionPath);
else
spellEngine = CreateSpellEngineLinux(affixPath, dictPath, exceptionPath);

spellEngine = new SpellEngineWeCantSpell(affixPath, dictPath, exceptionPath);
spellEngine.Initialize();
}
catch (Exception e)
Expand All @@ -43,20 +38,6 @@ internal static SpellEngine Create(string affixPath, string dictPath, string exc
return spellEngine;
}

private static SpellEngine CreateSpellEngineWindows(string affixPath, string dictPath,
string exceptionPath)
{
// Separate method so that we don't try to instantiate the class when running on Linux
return new SpellEngineWindows(affixPath, dictPath, exceptionPath);
}

private static SpellEngine CreateSpellEngineLinux(string affixPath, string dictPath,
string exceptionPath)
{
// Separate method so that we don't try to instantiate the class when running on Windows
return new SpellEngineLinux(affixPath, dictPath, exceptionPath);
}

internal SpellEngine(string exceptionPath)
{
ExceptionPath = exceptionPath;
Expand Down Expand Up @@ -84,17 +65,13 @@ private void Initialize()
}
}

/// <inheritdoc />
public abstract bool Check(string word);

private bool? _isVernacular;
public bool IsVernacular => _isVernacular ??= Check(SpellingHelper.PrototypeWord);

/// <inheritdoc />
public abstract bool IsVernacular { get; }

/// <inheritdoc />
public abstract ICollection<string> Suggest(string badWord);

/// <inheritdoc />
public void SetStatus(string word1, bool isCorrect)
{
var word = Normalizer.Normalize(word1, Normalizer.UNormalizationMode.UNORM_NFC);
Expand Down
Loading
Loading