apple-text-foundation-ref

Select Foundation or NaturalLanguage text utilities for text-processing tasks.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/sitapix/apple-text --skill apple-text-foundation-ref
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: apple-text-foundation-ref
Source: https://github.com/sitapix/apple-text/tree/main/skills/apple-text-foundation-ref
Command: npx skills add https://github.com/sitapix/apple-text --skill apple-text-foundation-ref

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers and AI systems identify and apply the exact Foundation or NaturalLanguage text utilities for a text-processing task, ensuring the right API is selected for the task at hand.

Core Features & Use Cases

  • Guidance on when to use NSRegularExpression, NSDataDetector, NLTagger, NLTokenizer, NLModel bridging, and NL embeddings.
  • Clear decision paths for choosing between classic Foundation utilities and modern Swift equivalents, with practical examples and compatibility notes.
  • Real-world scenarios include regex parsing, entity detection, language detection, tokenization, and bridging between String and NSString in iOS/macOS apps.

Quick Start

Ask this skill for the exact Foundation or NaturalLanguage tool to solve your text-processing problem.

Frequently Asked Questions about apple-text-foundation-ref

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between NLTagger and NSDataDetector for text processing in Swift?

NSDataDetector detects specific entities like dates and links, while NLTagger performs linguistic tagging for parts of speech. Choose NSDataDetector for structured entity extraction and NLTagger for grammatical analysis.

What is the best way to tokenize strings using the NaturalLanguage framework?

Tokenize strings using NLTokenizer, which breaks text into semantic units. It handles word, sentence, and paragraph boundaries, providing accurate tokenization for natural language processing tasks.

Does NSRegularExpression work with Swift String or do I need NSString bridging?

NSRegularExpression works with Swift String through automatic bridging to NSString. You can apply regex matching directly on Swift strings, but complex operations may require explicit NSString bridging.

How do I detect the language of user input text in iOS apps?

Detect language using NLLanguageRecognizer, which identifies the dominant language of a text input. It processes the string and returns an NLLanguage value representing the detected language.

When should I use NLEmbedding over NLLanguageRecognizer for text analysis?

Use NLEmbedding to calculate semantic similarity between strings through vector representations. Use NLLanguageRecognizer when you only need to identify the language of the text input.

Can I use NLModel for custom text classification alongside Foundation utilities?

NLModel supports custom text classification models trained with Create ML. You can integrate NLModel bridging with Foundation utilities to perform advanced categorization on detected tokens or entities.