Created
January 25, 2024 15:32
-
-
Save paulirwin/08c9d11d155d597e329857e7448d4e25 to your computer and use it in GitHub Desktop.
IKVM MavenReference error macOS arm64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net472</TargetFramework> | |
<RootNamespace>Bug</RootNamespace> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="IKVM.Maven.Sdk" Version="1.6.7" /> | |
</ItemGroup> | |
<ItemGroup> | |
<MavenReference Include="org.apache.opennlp:opennlp-tools" Version="1.9.4" /> | |
</ItemGroup> | |
<ItemGroup> | |
<None Update="en-sent.bin"> | |
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |
</None> | |
</ItemGroup> | |
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using opennlp.tools.sentdetect; | |
namespace Bug | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
// get en-sent.bin from OpenNLP | |
using var modelIn = new java.io.FileInputStream("en-sent.bin"); | |
var model = new SentenceModel(modelIn); | |
var sentenceDetector = new SentenceDetectorME(model); | |
var sentences = sentenceDetector.sentDetect(" First sentence. Second sentence. "); | |
Console.WriteLine(string.Join(";", sentences)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment