• Stars
    star
    377
  • Rank 113,535 (Top 3 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created almost 11 years ago
  • Updated about 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Syntax control for the command line

syn

Syntax control for the command line.

syn uses OS X's natural language processing tools to tokenize and highlight text (from standard input) that matches specified tags.

(Animated demo)

Inspired by iA Writer.

Install

syn requires OS X 10.7 or above.

$ curl -LOs https://github.com/stephencelis/syn/releases/download/v0.2.2/syn \
  && chmod 755 syn \
  && mv syn /usr/local/bin

Or clone/download the repository and run make install (requires Xcode to be installed).

Usage

E.g.,

# find pesky adverbs
$ syn --adverbs < nanowrimo.txt
# highlight nouns and noun-likes
$ syn --nouns --pronouns --personal-names --place-names < nanowrimo.txt
# peruse the classics
$ curl -Ls http://www.gutenberg.org/ebooks/11231.txt.utf-8 | \
  syn -A | \
  less -r
# generate listicles
$ syn -a -ftable < moby-dick.txt | \
  cut -d ' ' -f4 | sort -f | uniq -ci | sort -nr | head -10 | tr a-z A-Z
 441 OLD
 430 OTHER
 305 SUCH
 290 GREAT
 275 LAST
 238 LITTLE
 215 SAME
 199 OWN
 199 GOOD
 191 WHITE

-h,

usage: syn [tags] [-f <formatter=ansi>] [-vh]
Tags:
    -n, --nouns                      Match nouns
    -V, --verbs                      Match verbs
    -a, --adjectives                 Match adjectives
    -A, --adverbs                    Match adverbs
    -N, --pronouns                   Match pronouns
    -d, --determiners                Match determiners
    -p, --particles                  Match particles
    -P, --prepositions               Match prepositions
    -1, --numbers                    Match numbers
    -c, --conjunctions               Match conjunctions
    -i, --interjections              Match interjections
    -C, --classifiers                Match classifiers
    -I, --idioms                     Match idioms
    -H, --personal-names             Match personal (human) names
    -l, --place-names                Match place names (locations)

Configuration:
    -f, --formatter                  One of 'ansi', 'table', or 'json'

    -v, --version                    Show version
    -h, --help                       Show this screen

License

syn is available under the MIT license. See the LICENSE file for more information.

More Repositories

1

SQLite.swift

A type-safe, Swift-language layer over SQLite3.
Swift
9,718
star
2

ghi

GitHub Issues on the command line. Use your $EDITOR, not your browser.
Ruby
2,135
star
3

timeframe

Click-draggable. Range-makeable. A better calendar.
JavaScript
287
star
4

Formatting

Type-safe, functional string formatting in Swift.
Swift
248
star
5

sc_listener

A simple class for listening to microphone levels, suitable for the iPhone.
Objective-C
131
star
6

app

Easy App config.
Ruby
97
star
7

haddock

A more memorable password generator.
Ruby
88
star
8

githubbub

GitHubbub: A GitHub Fluid userscript. Growl/Dock notifications, and more.
JavaScript
84
star
9

minifacture

factory_girl for minitest
Ruby
69
star
10

BRLOptionParser

A short wrapper for getopt_long(3). Command line options parsing for Objective-C.
Objective-C
50
star
11

acts_as_singleton

A lightweight singleton library for your Active Record models.
Ruby
47
star
12

rdoctest

A doctest for Ruby. Parses RDoc text for examples and tests them.
Ruby
37
star
13

SQLiteCipher.swift

SQLite.swift + SQLCipher
Swift
33
star
14

dots

Free progress dots for your scripts. Test::Unit-style.
Ruby
33
star
15

vim-mml

Music Macro Language (MML) VIM plug-in. Edit, compile, and play NES chiptunes.
C
31
star
16

dotfiles

gone fishing
Ruby
26
star
17

rerails

Reinforcing the Rails with assorted patches.
Ruby
21
star
18

kvc

KVC (Key-Value Configuration): a powerful, transparent way to maintain mutable app settings in the database.
Ruby
14
star
19

ScreenshotWatcher

A demonstration of testing uncertainty in Swift Concurrency
Swift
7
star
20

scantron

Rule-based string scanning and scrubbing.
Ruby
7
star
21

Gestures.swift

iOS block-based gesture helpers.
Swift
7
star
22

EnumRuntimeBug

Swift
2
star
23

gorilla

Unit conversion for the underdog.
Ruby
2
star
24

actionview-data

HTML5 data attribute helpers for ActionView.
Ruby
1
star
25

swift-remove-first-benchmark

Swift
1
star
26

Platformer

Playing with Flixel.
ActionScript
1
star
27

scptest

Swift
1
star
28

CSQLite

System module for sqlite3
Swift
1
star
29

ghi-playground

Nothing to see here, folks.
1
star