Natural language processing from the command line, using native macOS APIs. Language detection, sentiment analysis, part-of-speech tagging, named entity recognition, structured entity extraction (phone numbers, emails, addresses, dates, flight numbers), and tokenization. All on-device, no API keys, no network calls.
$ echo "Bonjour le monde" | lingua detect
fr [0.98]
$ echo "The food was absolutely incredible" | lingua sentiment
1.0000
$ echo "Call 800-555-1212 or email [email protected] on March 3rd" | lingua entities
phone: 800-555-1212
email: [email protected]
date: March 3rdReads from stdin, writes to stdout. Pipes with curl, tezcatl, or anything else:
# Extract phone numbers from a webpage
curl -s https://example.com | lingua entities --type=phone
# Detect language of a rendered JS page
tezcatl https://example.com | lingua detect
# Score sentiment per sentence
echo "I love this. I hate that." | lingua sentiment --per-sentence
1.0000 I love this.
-0.6000 I hate that.All commands support --json for scripting.
Wraps Apple’s NaturalLanguage framework and NSDataDetector via Objective-C runtime bindings — no Swift, no Objective-C source files.
brew install georgemandis/tap/lingua