---
title: "Migrate from Catalyst NLP to OneNlp in C#"
url: https://recursiveai.org/onenlp/articles/migrate-from-catalyst/
description: "Two runnable examples show where the English pipelines disagree on contraction boundaries, part-of-speech tags, and lemmas."
date: 2026-11-27
author: OneNlp team
---

# Migrate from Catalyst NLP to OneNlp in C#

Two runnable examples show where the English pipelines disagree on contraction boundaries, part-of-speech tags, and lemmas.

November 27, 2026 · OneNlp team

Replace Catalyst’s `Pipeline.ForAsync`, `new Document`, and `ProcessSingle` with `Nlp.Analyze(text)`. Drop the `+ 1` when slicing with OneNlp’s exclusive `EndIdx`.

OneNlp is a free, open-source C# NLP library (tokens, sentences, POS tags, lemmas) from Recursive AI, licensed [MIT OR Apache-2.0](https://github.com/recursive-ai-oss/onenlp-csharp/blob/59bd14caa0e08a13494d74e29c396d1444730911/README.md#license). [NuGet: RecursiveAI.OneNlp](https://www.nuget.org/packages/RecursiveAI.OneNlp/1.0.0) · [GitHub: OneNlp](https://github.com/recursive-ai-oss/onenlp-csharp).

*OneNlp with English models · NuGet*

```
dotnet add package RecursiveAI.OneNlp --version 1.0.0
dotnet add package RecursiveAI.OneNlp.Models.English --version 1.0.0
```

## Run the same text through both pipelines

Use separate .NET 10 console projects. Both examples print sentence boundaries and token details. Every range shown is half-open: its left edge is included, its right edge is not.

### After: OneNlp

Reference the [English model package](https://www.nuget.org/packages/RecursiveAI.OneNlp.Models.English/1.0.0). `Nlp.Analyze` uses the packaged model; this call needs neither a registration method nor a model download.

*Program.cs · .NET 10*

```
using RecursiveAI.OneNlp;
 
Doc doc = Nlp.Analyze("We've met Ada. She runs.");
foreach (var sentence in doc.Sentences)
{
    Console.WriteLine("Sentence:");
    foreach (Token token in sentence)
    {
        Console.WriteLine($"[{token.Idx},{token.EndIdx}) {token.Text} | {token.Pos} | {token.Lemma}");
    }
}
```

Output columns: source range, source text, coarse POS tag, lemma.

*OneNlp 1.0.0 · Output*

```
Sentence:
[0,2) We | PRON | we
[2,5) 've | AUX | have
[6,9) met | VERB | meet
[10,13) Ada | PROPN | ada
[13,14) . | PUNCT | .
Sentence:
[15,18) She | PRON | she
[19,23) runs | VERB | run
[23,24) . | PUNCT | .
```

### Before: Catalyst

This follows [Catalyst’s setup example](https://docs.curiosity.ai/catalyst/#getting-started) using [Catalyst 26.10.6514](https://www.nuget.org/packages/Catalyst/26.10.6514) and [Catalyst.Models.English 26.9.5316](https://www.nuget.org/packages/Catalyst.Models.English/26.9.5316). Add one to the inclusive `End` before slicing the original string.

*Catalyst with English models · NuGet*

```
dotnet add package Catalyst --version 26.10.6514
dotnet add package Catalyst.Models.English --version 26.9.5316
```

*Program.cs · .NET 10*

```
using Catalyst;
using Mosaik.Core;
 
const string text = "We've met Ada. She runs.";
Catalyst.Models.English.Register();
Storage.Current = new DiskStorage("catalyst-models");
var nlp = await Pipeline.ForAsync(Language.English);
var doc = new Document(text, Language.English);
nlp.ProcessSingle(doc);
 
foreach (var sentence in doc.Spans)
{
    Console.WriteLine("Sentence:");
    foreach (var token in sentence.Tokens)
    {
        int end = token.End + 1;
        Console.WriteLine($"[{token.Begin},{end}) {text[token.Begin..end]} | {token.Value} | {token.POS} | {token.Lemma}");
    }
}
```

Output columns: source range, source text, `Value`, POS tag, lemma. `Value` is not always the source slice.

*Catalyst 26.10.6514 · Output*

```
Sentence:
[0,1) W | We | PRON | We
[1,5) e've | have | VERB | have
[6,9) met | met | VERB | meet
[10,13) Ada | Ada | PROPN | Ada
[13,14) . | . | PUNCT | .
Sentence:
[15,18) She | She | PRON | She
[19,23) runs | runs | VERB | run
[23,24) . | . | PUNCT | .
```

## Map the pipeline and its output

The rows map the calls used above and in [Catalyst’s document reference](https://docs.curiosity.ai/catalyst/document). The [OneNlp migration guide](https://github.com/recursive-ai-oss/onenlp-csharp/blob/59bd14caa0e08a13494d74e29c396d1444730911/docs/migration/catalyst.md#at-a-glance) also covers explicit pipelines and batch processing.

| Catalyst | OneNlp 1.0.0 | What to change |
|---|---|---|
| Register the English models; set `Storage.Current`. | Reference `RecursiveAI.OneNlp.Models.English`. | Remove the registration and storage setup for this packaged model. |
| `Pipeline.ForAsync(Language.English)`, `new Document`, then `ProcessSingle` | `Doc doc = Nlp.Analyze(text)` | Use the returned document rather than an object you create and pass in for annotation. |
| `doc.Spans`, then `sentence.Tokens` | `doc.Sentences`, then iterate the span | Use the document’s sentence ranges, not positions inferred from the previous tokenizer. |
| `Begin`, inclusive `End` | `Idx`, exclusive `EndIdx` | Don’t carry over the `+ 1` when slicing OneNlp results. Its offsets are UTF-16 code units into the original string. |
| `Value` (can differ from source text) | `Text` for source text; `Norm` for a supplied normalized form | Keep display text separate from normalization. `Norm` is empty when no component sets it. |
| `POS` and `Lemma` | `Pos` and `Lemma` | `Pos` is a coarse Universal Dependencies tag string. OneNlp’s separate `Tag` is the fine-grained tag. |

## Recheck spans, models, and tags before switching

- **Offsets:** Converting the endpoint convention doesn’t align token boundaries. In the sample, the contraction’s second range starts at 1 in Catalyst and 2 in OneNlp. Recompute highlights against the original input. Test contractions and non-ASCII text, including characters that take two UTF-16 code units.
- **Tags and lemmas:** The example’s second token changes from `VERB` to `AUX`, and `Ada` becomes the lemma `ada` rather than `Ada`. Audit tag filters and lemma lookup keys on your own text instead of translating property names alone.
- **Models and labels:** OneNlp doesn’t load models trained for Catalyst. For your own trained components, plan to [retrain](https://recursiveai.org/onenlp/docs/training/). If you consume entity annotations, review the [entity label scheme](https://github.com/recursive-ai-oss/onenlp-csharp/blob/59bd14caa0e08a13494d74e29c396d1444730911/docs/migration/catalyst.md#differences-that-matter-when-you-port) and test the labels and span boundaries that your application expects.
