<commit_before>/**
 * shorthand.go - command line utility to process shorthand definitions
 * and render output with the transformed text and without any
 * shorthand definitions.
 * @author <NAME>, <<EMAIL>>
 * copyright (c) 2015 all rights reserved.
 * Released under the BSD 2-Clause license.
 * See: http://opensource.org/licenses/BSD-2-Clause
 */
package main

import (
	"../../shorthand"
	"bufio"
	"errors"
	"flag"
	"fmt"
	"os"
)

type expressionList []string

var (
	help       bool
	expression expressionList
)

var usage = func(exit_code int, msg string) {
	var fh = os.Stderr
	if exit_code == 0 {
		fh = os.Stdout
	}
	cmdName := os.Args[0]

	fmt.Fprintf(fh, `%s
USAGE %s [options]

%s is a command line utility to process shorthand definitions
and render output with the transformed text and without the
shorthand definitions themselves. It reads from standard input
and writes to standard output. The form is

    LABEL := VALUE

To create a shortand for the label "ACME" with the value
"the point at which someone or something is best"
would be done with the following line

    ACME := the point at which someone or something is best

Now each time the shorthand "ACME" is encountered the phrase
"the point at which someone or something is best" will replace it. Thus

    My, ACME, will come

would become

    My, the point at which someone or something is best, will come

Normally you would use shorthands for things like long project names,
passing dynamic values (like the current time or date) via the command line.

Additionally you can include a file with the colon less than sign.

    LABEL :< PATH_TO_FILE_TO_INCLUDE

This included file, once read, is processed the same as other label assignments.


EXAMPLE

Pass the current date and time as shorthands transform the file "input.txt"
into "output.txt" with shorthands converted.

    %s -e "@now := $(date +%%H:%%M)" \
	   -e "@today := $(date +%%Y-%%m-%%d)" < input.txt > output.txt

OPTIONS
`, msg, cmdName, cmdName, cmdName)

	flag.VisitAll(func(f *flag.Flag) {
		fmt.Fprintf(fh, "\t-%s\t\t%s\n", f.Name, f.Usage)
	})
<commit_msg>Added shell output assignment to shorthand.<commit_after>/**
 * shorthand.go - command line utility to process shorthand definitions
 * and render output with the transformed text and without any
 * shorthand definitions.
 * @author <NAME>, <<EMAIL>>
 * copyright (c) 2015 all rights reserved.
 * Released under the BSD 2-Clause license.
 * See: http://opensource.org/licenses/BSD-2-Clause
 */
package main

import (
	"../../shorthand"
	"bufio"
	"errors"
	"flag"
	"fmt"
	"os"
)

type expressionList []string

var (
	help       bool
	expression expressionList
)

var usage = func(exit_code int, msg string) {
	var fh = os.Stderr
	if exit_code == 0 {
		fh = os.Stdout
	}
	cmdName := os.Args[0]

	fmt.Fprintf(fh, `%s
USAGE %s [options]

%s is a command line utility to process shorthand definitions
and render output with the transformed text and without the
shorthand definitions themselves. It reads from standard input
and writes to standard output. The form is

    LABEL := VALUE

To create a shortand for the label "ACME" with the value
"the point at which someone or something is best"
would be done with the following line

    ACME := the point at which someone or something is best

Now each time the shorthand "ACME" is encountered the phrase
"the point at which someone or something is best" will replace it. Thus

    My, ACME, will come

would become

    My, the point at which someone or something is best, will come

Normally you would use shorthands for things like long project names,
passing dynamic values (like the current time or date) via the command line.

Additionally you can include a file with the colon less than sign.

    LABEL :< PATH_TO_FILE_TO_INCLUDE

This included file, once read, is processed the same as other label assignments.

Finally you can pipe the contents of a shell command into a label from within shorthand.

	LABEL :! SHELL_COMMANDS


EXAMPLE

Pass the current date and time as shorthands transform the file "input.txt"
into "output.txt" with shorthands converted.

    %s -e "@now := $(date +%%H:%%M)" \
	   -e "@today := $(date +%%Y-%%m-%%d)" < input.txt > output.txt


OPTIONS
`, msg, cmdName, cmdName, cmdName)

	flag.VisitAll(func(f *flag.Flag) {
		fmt.Fprintf(fh, "\t-%s\t\t%s\n", f.Name, f.Usage)
	})

{'fraction_non_alphanumeric': 0.09159606136936112, 'fraction_numerical': 0.0036638424547744447, 'mean_word_length': 3.691729323308271, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5687677', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1314, 'n_words': 589}