# natural-language

A skill for on-device text work: tokenization, language detection, part-of-speech tags, entities, sentiment and translation in Apple apps.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3700 installs · ★ 1237
- Author: dpearson2699
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/natural-language/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/natural-language

## What it does

The skill covers two Apple frameworks. NaturalLanguage brings `NLTokenizer`, `NLTagger` and `NLEmbedding` for analysis that runs on device, while Translation brings `TranslationSession` and `LanguageAvailability` for moving text between languages. Reach for it once the text is already in your app and needs tagging or translating.

Inside are recipes for each job: splitting text into words, sentences and paragraphs, detecting the dominant language with confidence scores, tagging parts of speech, pulling out personal names, places and organizations, scoring sentiment from -1.0 to +1.0, and building word and sentence embeddings. There is also a common-mistakes section and a review checklist.

The scope is drawn tightly. OCR belongs to `vision-framework`, speech-to-text to `speech-recognition`, UI strings and locale formatting to `ios-localization`, generative summaries to `apple-on-device-ai`. `NLTokenizer` and `NLTagger` are not thread-safe, so keep each instance on one thread or queue. NaturalLanguage needs no special entitlements; Translation splits by version — the system translation UI is iOS 17.4+ and macOS 14.4+, while `TranslationSession`, `.translationTask()`, `LanguageAvailability` and batch translation need iOS 18+ and macOS 15+. Direct `TranslationSession(installedSource:target:)` skips the UI, but only when both languages are already installed on the device.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill natural-language -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/natural-language/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/natural-language/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill natural-language -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/natural-language/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill natural-language -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/natural-language/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dpearson2699/swift-ios-skills natural-language
```

2. **Manually: put the files in place**
- File: `.github/skills/natural-language/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill natural-language -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/natural-language
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/natural-language/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill natural-language -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/natural-language/SKILL.md

## When to use it
- split a block of text into words, sentences and paragraphs
- detect the language of a short string with a confidence score
- pull names, places and organizations out of a review
- score the sentiment of a paragraph as a number
- find words close in meaning through embeddings

## Example prompts
- Add language detection to the input field using NLLanguageRecognizer
- I need sentiment for user reviews — do it with NLTagger and .sentimentScore
- Wire up in-app translation on iOS 18 through TranslationSession

## Similar
- [apple-intelligence](https://affpapa.org/en/nevibecode/skills/apple-intelligence.md) — skill · 516 installs
- [usernotifications](https://affpapa.org/en/nevibecode/skills/usernotifications.md) — skill · 473 installs
- [backgroundtasks](https://affpapa.org/en/nevibecode/skills/backgroundtasks.md) — skill · 467 installs
- [mongodb-natural-language-querying](https://affpapa.org/en/nevibecode/skills/mongodb-natural-language-querying.md) — skill · 4700 installs
- [answering-natural-language-questions-with-dbt](https://affpapa.org/en/nevibecode/skills/answering-natural-language-questions-with-dbt.md) — skill · 1000 installs
- [language-swap](https://affpapa.org/en/nevibecode/skills/language-swap.md) — skill · 1200 installs

From the same set: [dpearson2699/swift-ios-skills](https://affpapa.org/en/nevibecode/by/dpearson2699/swift-ios-skills.md) — 86 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
