Code Monkey home page Code Monkey logo

occam's Introduction

occam

Remove adjectives and adverbs from text.

A CLI tool for German text, powered by the NLP rocket science of spaCy ๐Ÿš€.

โค๏ธ For ๐Ÿ‚ keyboardmonkee, ๐Ÿฆ‹ redadmiral & ๐Ÿฆ€ schwukas โค๏ธ

Philosophy

Inspired by the principle of Occam's razor โœ‚๏ธ:

It is pointless to do with more what can be done with fewer.

William of Ockham (ca.1287-1347), Summa Totius Logicae

The simplest solution is most likely the right one - this also holds true for writing. However, it is a difficult task to declutter text, to strip it down to the gist of what one wants to express.

An easy way to start is to reconsider how a text uses adjectives and adverbs. Both can contribute to expressiveness, but they can also make a text feel clumsy if they only serve as embellishments.

occam to the rescue! occam shows how your text would look without adjectives and adverbs. Thus, it helps you to reconsider how you could make your text more concise.

Setup

# create a virtual environment
$ python -m venv ./venv

# install required dependencies
$ pip install -r requirements.txt

# download the German language model by spaCy
$ python -m spacy download de

Usage

Usage: occam.py [OPTIONS]

  Remove adjectives and adverbs from text.

Options:
  -f, --file TEXT    File with text input.
  -t, --text TEXT    String with text input.
  -o, --output TEXT  Path to output file (optional, otherwise print to CLI).
  -j, --adj          Only remove adjectives (default: remove adjectives and
                     adverbs).
  -v, --adv          Only remove adverbs.
  -s, --sub TEXT     String by which adjectives and adverbs shall be replaced.
  -c, --count        Display the number of removed words.
  --help             Show this message and exit.

occam's People

Contributors

acidann avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

occam's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.