wolfgarbe / SymSpell

SymSpell: 1 million times faster spelling correction & fuzzy search through Symmetric Delete spelling correction algorithm
https://seekstorm.com/blog/1000x-spelling-correction/
MIT License
3.15k stars 298 forks source link

nuspec needs to change .net472 to .net47 #111

Closed ccady closed 3 years ago

ccady commented 3 years ago

I cannot currently use the SymSpell 6.7 NuGet package in my production .NetFramework 4.7 application because the SymSpell .nuspec has a dependency on .NetFramework 4.6.1 which requires System.ValueTuple >=4.4.0, and then another for .NetFramework 4.7.2 which removes that dependency. The problem is that NuGet interprets .NetFramework 4.7 as being less than .NetFramework 4.7.2, so it then requires a dependency on System.ValueTuple, but System.ValueTuple is already a part of .NetFramework 4.7. This causes an error in compiling. The solution would be to change the .nuspec to not require anything from .NetFramework 4.7, instead of .NetFramework 4.7.2.

(I found a way to hack workaround for the problem, and that was to make my own dependency on a later version of System.ValueTuple (4.5.0) so that the compiler picks that one instead of trying to include 4.4.0 twice and giving a compile error.)

ccady commented 3 years ago

I would have made the change and done a pull request, but it does not look like the .nuspec file is in the repository.

wolfgarbe commented 3 years ago

I'm creating the NuGet package with .the CLI and the package properties in the csproj file, instead of nuget.exe and a .nuspec file, https://docs.microsoft.com/en-us/nuget/create-packages/creating-a-package https://docs.microsoft.com/en-us/nuget/create-packages/creating-a-package-dotnet-cli

  <PropertyGroup>
    <TargetFrameworks>netstandard2.0;net461;net472;</TargetFrameworks>
    <DebugType>pdbonly</DebugType>
    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
    <PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
    <Authors>Wolf Garbe &lt;wolf.garbe@seekstorm.com&gt;</Authors>
    <Company>Wolf Garbe &lt;wolf.garbe@seekstorm.com&gt;</Company>
    <Product>SymSpell</Product>
    <Description>Spelling correction &amp; Fuzzy search: 1 million times faster through Symmetric Delete spelling correction algorithm</Description>
    <Copyright>Copyright (C) 2020 Wolf Garbe</Copyright>
    <PackageProjectUrl>https://github.com/wolfgarbe/symspell</PackageProjectUrl>
    <RepositoryUrl>https://github.com/wolfgarbe</RepositoryUrl>
    <RepositoryType>Git</RepositoryType>
    <PackageTags>symspell, spelling-correction, spellcheck, spell-check, spelling, fuzzy-search, approximate-string-matching, edit-distance, levenshtein, levenshtein-distance, damerau-levenshtein, word segmentation</PackageTags>
      <PackageReleaseNotes>WordSegmentation improved for uppercase, punctuation, apostrophe and ligatures. \r\n
American English word forms added to dictionary. \r\n
LoadDictionary and LoadBigramDictionary now have an optional separator parameter, which defines the separator characters (e.g. '\t') between term(s) and count. Default is defaultSeparatorChars=null for white space. This allows the dictionaries to contain space separated phrases.</PackageReleaseNotes>
    <Version>6.7</Version>
    <PackageLicenseExpression>MIT</PackageLicenseExpression>
  </PropertyGroup>

So I could change net472 to net47 the in the line <TargetFrameworks>netstandard2.0;net461;net472;</TargetFrameworks>

ccady commented 3 years ago

Since you are already explicitly targeting net472, I would leave it in place and simply add the net47 target also. But either replacing it or adding another target should both work.

wolfgarbe commented 3 years ago

A new NuGet package has been uploaded