Skip to content

java to dotnet migration quickstart

Ozan KANIK edited this page Apr 12, 2026 · 1 revision

Java to .NET Migration Quickstart

This page helps teams migrate from Java Zemberek usage patterns to ZemberekDotNet with minimal friction.

1. Dependency Setup

Java (Maven):

<dependency>
  <groupId>zemberek-nlp</groupId>
  <artifactId>zemberek-morphology</artifactId>
  <version>0.17.1</version>
</dependency>

.NET (NuGet):

dotnet add package ZemberekDotNet.Morphology

All modules:

dotnet add package ZemberekDotNet.All

2. Morphology

Java:

TurkishMorphology morphology = TurkishMorphology.createWithDefaults();
SentenceAnalysis analysis = morphology.analyzeAndDisambiguate("Yarın okula gideceğim.");

.NET:

TurkishMorphology morphology = TurkishMorphology.CreateWithDefaults();
SentenceAnalysis analysis = morphology.AnalyzeAndDisambiguate("Yarın okula gideceğim.");

3. Tokenization

Java:

List<Token> tokens = TurkishTokenizer.DEFAULT.tokenize("Merhaba dünya.");

.NET:

List<Token> tokens = TurkishTokenizer.Default.Tokenize("Merhaba dünya.");

4. Sentence Extraction

Java:

List<String> sentences = TurkishSentenceExtractor.DEFAULT.fromParagraph(text);

.NET:

List<string> sentences = TurkishSentenceExtractor.Default.FromParagraph(text);

5. Language Identification

Java:

LanguageIdentifier lid = LanguageIdentifier.fromInternalModels();
String lang = lid.identify("merhaba dünya");

.NET:

LanguageIdentifier lid = LanguageIdentifier.FromInternalModels();
string lang = lid.Identify("merhaba dünya");

6. NER

Java:

PerceptronNer ner = PerceptronNer.loadModel(modelRoot, morphology);
NerSentence result = ner.findNamedEntities(sentence);

.NET:

PerceptronNer ner = PerceptronNer.LoadModel(modelRoot, morphology);
NerSentence result = ner.FindNamedEntities(sentence);

7. Typical Naming Differences

Java .NET
createWithDefaults() CreateWithDefaults()
analyzeAndDisambiguate() AnalyzeAndDisambiguate()
DEFAULT Default
fromParagraph() FromParagraph()
identify() Identify()

8. Practical Notes

  • Keep one long-lived TurkishMorphology instance in app lifetime.
  • Prefer module-specific examples in this repository when behavior differs from old Java snippets.
  • gRPC usage is deferred for future in this repository and is outside current port-completion scope.

Clone this wiki locally