style TEXT-FILE

Analyse writing style of writing style of a document

Style analyses the surface characteristics of the writing style of a document. It prints various readability grades, length of words, sentences and paragraphs. It can further locate sentences with certain characteristics. If no files are given, the document is read from standard input. style is part of "diction" package
Sample Output
$ style /usr/share/common-licenses/GPL

readability grades:
        Kincaid: 13.7
        ARI: 16.0
        Coleman-Liau: 13.3
        Flesch Index: 47.2/100
        Fog Index: 16.8
        Lix: 57.5 = higher than school year 11
        SMOG-Grading: 13.8
sentence info:
        27589 characters
        5588 words, average length 4.94 characters = 1.55 syllables
        197 sentences, average length 28.4 words
        53% (106) short sentences (at most 23 words)
        22% (45) long sentences (at least 38 words)
        109 paragraphs, average length 1.8 sentences
        0% (0) questions
        47% (94) passive sentences
        longest sent 152 wds at sent 112; shortest sent 1 wds at sent 29
word usage:
        verb types:
        to be (137) auxiliary (91) 
        types as % of total:
        conjunctions 7% (378) pronouns 8% (444) prepositions 13% (720)
        nominalizations 3% (147)
sentence beginnings:
        pronoun (32) interrogative pronoun (3) article (33)
        subordinating conjunction (23) conjunction (3) preposition (13)

2
2010-10-27 08:07:04

These Might Interest You

  • When writing on the command line of zsh, by pressing Alt+q the command will be cleaned, and you can insert another one. The command you were writing will be recorder, and pasted on the prompt immediately after the "interrupting" command is inserted. Show Sample Output


    5
    <alt+q>
    luther · 2009-10-29 14:55:12 1
  • the --time-style argument to 'ls' takes several possible modifiers: full-iso, long-iso, iso, locale, +FORMAT. The +FORMAT modifier uses the same syntax as date +FORMAT. --time-style=+"%Y-%m-%d %H:%M:%S" strikes a happy medium between accuracy and verbosity: ls -lart --time-style=long-iso doesn't show time down to the nearest second, ls -lart --time-style=full-iso displays time to 10E-9 second resolution, but with no significant digits past the full seconds, also showing the timezone: -rw-r--r-- 1 bchittenden bchittenden 0 2011-02-10 12:07:55.000000000 -0500 bar Show Sample Output


    4
    ls -l --time-style=+"%Y-%m-%d %H:%M:%S"
    bartonski · 2011-02-10 17:15:37 2
  • Same as the cool matrix style command ( http://www.commandlinefu.com/commands/view/3652/matrix-style ), except replacing the printed character with randomness. The command mentioned is much faster and thus more true to the matrix. However, mine can be optimized, but I wasted ... i mean spent enough time on it already Show Sample Output


    6
    check the sample output below, the command was too long :(
    pykler · 2009-09-29 19:30:10 2
  • instead of writing: if [[ "$1" == "$2" ]]; then echo "$1 is equal $2" else echo "$1 differs from $2" fi do write: [[ "$1" == "$2" ]] && echo "$1 is equal $2" || echo "$1 differs from $2"


    24
    [[ test_condition ]] && if_true_do_this || otherwise_do_that
    stallmer · 2009-02-20 21:45:21 2
  • Count your source and header file's line numbers. This ignores blank lines, C++ style comments, single line C style comments. This will not ignore blank lines with tabs or multiline C style comments.


    1
    find /usr/include/ -name '*.[c|h]pp' -o -name '*.[ch]' -print0 | xargs -0 cat | grep -v "^ *$" | grep -v "^ *//" | grep -v "^ */\*.*\*/" | wc -l
    unixmonkey44446 · 2013-06-17 08:37:37 0
  • Useful for switching over someone else's coding style who uses camelCase notation to your style using all lowercase with underscores. Show Sample Output


    11
    sed -r 's/([a-z]+)([A-Z][a-z]+)/\1_\l\2/g' file.txt
    atoponce · 2009-04-28 22:44:45 9

What Others Think

sorry for the typo, I meant "Analyse writing style of a document" as title..
alperyilmaz · 394 weeks and 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: