All Projects → Flight-School → Pos

Flight-School / Pos

Licence: mit
A command-line utility for tagging part of speech for words in text.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Pos

Judge
Online Judge Kernel,Virtual Judge Adapter,Command-Line Interface, Telnet Server, FTP Server
Stars: ✭ 35 (-10.26%)
Mutual labels:  cli
Cli
GraphQL back-end framework with first-class Typescript support
Stars: ✭ 37 (-5.13%)
Mutual labels:  cli
Kubetop
Kubernetes nodes, pods, services, and deployments in a glance
Stars: ✭ 37 (-5.13%)
Mutual labels:  cli
Composify
Turn WordPress plugin zip files into git repositories, so that composer version constraints work properly.
Stars: ✭ 36 (-7.69%)
Mutual labels:  cli
Gomodctl
Search, Check, and Update Go modules.
Stars: ✭ 37 (-5.13%)
Mutual labels:  cli
Fuego
fuego is a library for automatically generating command line interfaces (CLIs) from function and struct.
Stars: ✭ 37 (-5.13%)
Mutual labels:  cli
Moviescore
A cli tool to get movie ratings and reviews directly to your terminal!
Stars: ✭ 35 (-10.26%)
Mutual labels:  cli
Make Me Lol
😄 A command-line tool to make you laugh
Stars: ✭ 38 (-2.56%)
Mutual labels:  cli
Spinnercpp
Simple header only library to add a spinner / progress indicator to any terminal application.
Stars: ✭ 37 (-5.13%)
Mutual labels:  cli
Usacloud
usacloud🐰 : CLI client for the Sakura Cloud🌸☁️
Stars: ✭ 37 (-5.13%)
Mutual labels:  cli
Lyft
Create and manage Lyft rides from the command line
Stars: ✭ 36 (-7.69%)
Mutual labels:  cli
Mythra
Music retrieval CLI and API using rust
Stars: ✭ 37 (-5.13%)
Mutual labels:  cli
Rocket.chat.apps Cli
The CLI for interacting with Rocket.Chat Apps
Stars: ✭ 37 (-5.13%)
Mutual labels:  cli
Dotnet Delice
📑 A CLI to help you get insight into your projects' licenses
Stars: ✭ 36 (-7.69%)
Mutual labels:  cli
Simplifyify
A simplified Browserify and Watchify CLI
Stars: ✭ 37 (-5.13%)
Mutual labels:  cli
Langterm
🕹️ WebGL-based VT220 emulator, made as a learning example and frontend for a text adventure
Stars: ✭ 35 (-10.26%)
Mutual labels:  cli
Sqlite Global Tool
SQLite .NET Core CLI tool that allows the user to manually enter and execute SQL statements with or without showing query result.
Stars: ✭ 37 (-5.13%)
Mutual labels:  cli
Cli Badges
Quirky little node-js library for generating badges for your cli apps.
Stars: ✭ 39 (+0%)
Mutual labels:  cli
Kotlin Cli
Kotlin-CLI - command line interface options parser for Kotlin
Stars: ✭ 37 (-5.13%)
Mutual labels:  cli
Create Wxapp Page
创建微信小程序页面的命令行工具
Stars: ✭ 37 (-5.13%)
Mutual labels:  cli

pos

pos is a command-line utility for tagging part of speech (POS) for words in text.

$ echo "The quick brown fox jumps over the lazy dog." | pos
DETERMINER	The
ADJECTIVE	quick
ADJECTIVE	brown
NOUN	fox
VERB	jumps
PREPOSITION	over
DETERMINER	the
ADJECTIVE	lazy
NOUN	dog

For more information about natural language processing, check out Chapter 7 of the Flight School Guide to Swift Strings.


Requirements

  • macOS 10.12+

Installation

Install pos with Homebrew using the following command:

$ brew install flight-school/formulae/pos

Usage

Text can be read from either standard input or file arguments. Tagged words are written to standard output on separate lines.

Reading from Piped Standard Input

$ echo "Designed by Apple in California." | pos
VERB	Designed
PREPOSITION	by
NOUN	Apple
PREPOSITION	in
NOUN	California

Reading from Standard Input Interactively

$ pos
This text is being typed into standard input.
DETERMINER	This
NOUN	text
VERB	is
VERB	being
VERB	typed
PREPOSITION	into
ADJECTIVE	standard
NOUN	input

Reading from a File

$ cat german-pangram.txt
Falsches Üben von Xylophonmusik quält jeden größeren Zwerg

$ pos german-pangram.txt
ADJECTIVE	Falsches
NOUN	Üben
PREPOSITION	von
NOUN	Xylophonmusik
VERB	quält
DETERMINER	jeden
ADJECTIVE	größeren
NOUN	Zwerg

Advanced Usage

pos can be chained with Unix text processing commands, like cut, sort, uniq, comm, grep sed, and awk.

Filtering Tags

$ pos german-pangram.txt | grep NOUN | cut -f2
Üben
Xylophonmusik
Zwerg

Additional Details

Tagged words are written to standard output on separate lines. Each line consists of the part of speech tag (see table below), followed by a tab (\t), followed by the token:

^(?<tag>([A-Z]+)\t(?<token>.+)$

pos uses NLTagger when available, falling back on NSLinguisticTagger for older versions of macOS.

Part of Speech Tags

  • ADJECTIVE
  • ADVERB
  • CLASSIFIER
  • CONJUNCTION
  • DETERMINER
  • IDIOM
  • INTERJECTION
  • NOUN
  • NUMBER
  • PARTICLE
  • PREPOSITION
  • PRONOUN
  • VERB

License

MIT

Contact

Mattt (@mattt)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].