0.2.1 • Published 2 years ago

american-british-english-translator v0.2.1

Weekly downloads
215
License
MIT
Repository
github
Last release
2 years ago

American British English Translator

Now online at: https://codewordsolver.com/american-british-english-translator

Reads in a text and identifies words that differ in usage between American English and British English, including: 1. Words with alternative spellings ("cozy" / "cosy") 2. Words with different meanings in each of the two dialects ("pants") 3. Words typically used in only one of the dialects ("ladybug" / "ladybird")

Existing solutions only notice the first category of words, thus failing to prevent the most embarrassing mistakes, such as a British person asking an American colleague for a "rubber".

Installation

$ npm install -g american-british-english-translator

This will install the command english-translate globally, so it will be added automatically to your PATH.

Usage (CLI)

The command line interface can be used in three different ways:

Pipe stdin:

$ echo "That was a right bodge job" | english-translate

Example 2

Analyze a file:

$ english-translate American\ Psycho.txt

Example 1

Prompt:

$ english-translate

Example 3

Command line options

By default english-translate outputs almost everything it can*, but it's possible to refine the output and thus speed up the program by using some command line options:

# Only identify Americanisms
$ english-translate file.txt --american

# Only identify Britishisms
$ english-translate --british

# Only check for spelling differences
$ english-translate --spelling

# Only check for British spellings
$ english-translate --british --spelling

# Don't check spelling differences or different meanings, only check for meanings exclusive to one of the dialects
$ english-translate --exclusive

# Print only the first instance of any identified words
$ english-translate --firstonly

# Do not use colors
$ english-translate --no-color
  • Common words with tiny subtleties in meaning, such as 'can' or 'through', are ignored by default. These words are configured in data/ignore_list.json. If you want to include them then pass the --showall flag.

Usage (from Node.js)

Include it in your script and call the translate() method:

var translator = require('american-british-english-translator');

var data = "I was gobsmacked";

var options = {
  british: true
};

console.log(JSON.stringify(translator.translate(data, options)));

Sources

Uses modified versions of the following lists:

0.2.1

2 years ago

0.2.0

2 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

7 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.1

9 years ago