Plaintext prose redundancy linter. https://github.com/gbgar/Wordlint

Latest on Hackage:

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

OtherLicense licensed by GB Gardner

Wordlint locates matching pairs of words repeated within a user-defined distance. Text may be linted by distance between words (that is, by word count), by line count, and/or by percentage of the total words in the file. For details on running the program, see README or the included man page. Internally, Wordlint separates a text file (or stdin) into a list of Words, after processing user flags. An instance of the Word datatype consisting of a String that contains a lemma; its line and column coordinates; and its "position": an Int or Float depending on the type of check invoked by the user. This list is first filtered by the user-defined minimum length of the lemma. Next, items are matched by their lemma and exclusive coordinates before being added to a list of Wordpairs, a data structure containing two Words and the difference between their respective "positions". If multiple types are specified, all Int positions are converted to the Double type and the resulting lists are intersected to produce the final results. Finally, these Wordpairs are optionally filtered by the difference in their positions (another user-specified option). All remaining Wordpairs are processed for printing to stdout in machine-readable (default) or human-readable format. Plugins exist for integration with Vim (https://github.com/gbgar/Wordlint.vim) and Emacs (https://github.com/gbgar/wordlint.el).


2015-02-19 - version

This version brings breaking changes if you typically
use a non-default set of linting arguments.

- Command line arguments -w/--wordlength, -d/--distance and -t/--type
have been removed.

- The -m/--matchlength replaces -w/--wordlength

- The-w/--words, -l/--lines, and -p/--percent take Int/Int/Double, respectively.
The parameter itself represents the type of lint you wish to perform, while the
argument provided by the user indicates the maximum distance between matches.

- Intersecting lints have been added. The type/distance arguments provided (or not)
are used to create a set of lists. The intersection of these lists
is provided as the end result.

- Some granularity in the human-readable data has been lost. Due to the addition of
intersecting lints, all final results are treated as Doubles, and the "intervening
distance" between word pairs are unlabeled. This is no issue if running one type of
lint, but with more, it is difficult to sort out which unit is being provided.

- Wordlint.hs has been heavily manicured.

- Wordlint.Linters and the `Linter` datatype and associated functions have been
taken the place of the `run*Linter` family of functions in Wordlint.hs

- Wordlint.Output has been added to house the Human/Machine functions from Wordlint.hs.
These functions have been pruned and some higher-level functions added.

2014-12-01 - version

- Changed "-s vim" to "-s error".

- Changed output of "-s error" to produce better, text editor-agnostic output.

2014-11-25 - version

- Added labels to machine-readable output table.

Depends on:
Used by 1 package:
comments powered byDisqus