Skip to content

Instantly share code, notes, and snippets.

@paulirwin
Created January 25, 2024 15:32
Show Gist options
  • Save paulirwin/08c9d11d155d597e329857e7448d4e25 to your computer and use it in GitHub Desktop.
Save paulirwin/08c9d11d155d597e329857e7448d4e25 to your computer and use it in GitHub Desktop.
IKVM MavenReference error macOS arm64
<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>
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