Giter VIP home page Giter VIP logo

test-text's Introduction

Test::Text

Build Status

Objective

A module for testing and doing other kind of metrics on regular text, as in books or novels, or, for that matter, manuals.

We're not there yet, but for the time being it is a pretty good spelling checker that can be used on the cloud in continuous integration literary environments.

who is this module for?

People who write fiction or non-fiction using simple text, Markdown or similar formats. You don't need to know Perl or continuous integration or nothing more techie than clicking here and there and saving files. You probably do know programming stuff, but it's not really needed for using it.

what is this for?

Saves you time by checking spelling automatically. Also measures progress by telling you how many words you have written so far and in total, which is an intended side effect of counting the number of tests == number of words.

how can I use it in a CI pipeline?

  1. Save the files you want to be tested to a single directory called, for instance, text, using .markdown, .txt or .md extensions. That directory will also hold the words.dic where you will save real words that are not included in the general dictionary. That's your personal dictionary, for short.

  2. Sign up for Travis CI. You can use your GitHub account. Choose the repo where your text is hosted and enable it. You might have to sync your account if the repo has been recently created.

  3. Create a .travis.yml configuration file in the home directory of your repo. There are a couple of examples (English and Spanish) in this repo. You can also copy and paste this

branches:
  except:
    - gh-pages
language: perl
perl:
  - "5.22"
before_install:
  - sudo apt-get install libhunspell-1.3-0 libhunspell-dev
  - curl https://raw.githubusercontent.com/JJ/Test-Text/master/files/just_check_en.t -o just_check.t
  - sudo update-locale LANG=en_US.UTF-8 LANGUAGE=en.UTF-8
install: cpanm Test::Text TAP::Harness
script: perl -MTAP::Harness -e 'use utf8; my $harness = TAP::Harness->new( { verbosity => 0} ); die "FAIL" if $harness->runtests( "just_check.t" )->failed;'

and save it to that file. You can also use examples like this one for a data science manual directly:

wget https://github.com/JJ/aprende-datos/blob/master/.travis.yml

That's it. Every time you push, your text files will be checked and it will return the words that it does not know about. You can them fix them or enter them in your words.dic file, with this format

4
OneWord
AnotherWord
FooBar
Þor

Simple enough, ain't it?

You can also directly use this GitHub action in your repository to have the README checked. It deletes all markdown elements that are not README, you might have to adapt it to your situation (or leave it there).

it does not work!

You can raise an issue requesting help.

I'd like to help!

Help with other languages would be great. Adding tests other than pure spell checking, like grammar, would be great too. Check out the issues and the TODO file for ideas, or create your own issues.

LICENSES

This distribution is licensed under the GPL. In includes Test::Text::Sentence, originally Text::Sentence from HTML::Summary, (c) by NEILB, initial copyright by CRE, and licensed under the Artistic license.

test-text's People

Contributors

jj avatar manwar avatar neilb avatar szabgab avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

manwar neilb

test-text's Issues

Better management of personal dictionaries

Right now, they are placed in the document directory, which is a problem because you will need one for every single directory in an installation. They should be placed in the data directory, perhaps additionally.
Additionally, there's a single warning (and no bailout) when there's no user's dictionary. It should probably be an error.

Use text filters

So that URLs, code and things like that are not spell-checked.

Changes file doesn't follow expected format

The Changes file doesn't follow the spec in CPAN::Changes::Spec, which means various tools can't process / present it.

If the changes file is formatted this way, then MetaCPAN's page for the distribution will present the changes from the most recent release.

If you're interested, I'll be happy to submit a PR for this, which will help towards my hacktoberfest t-shirt ;-)

Cheers,
Neil

Improve documentation

Well, it looks like it's only me using it, but I forget from time to time, so explain how to configure it for several directories, for instance.

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.