<commit_before>package appbuilder

import (
	"github.com/codegangsta/cli"
	"github.com/idekerlab/cxtool/converter"
)

// File formats
const (
	csv = "csv"
	tsv = "tsv"
	cx = "cx"
	sif = "sif"
	cytoscapejs = "cyjs"
)

func BuildApp() *cli.App {
	app := cli.NewApp()
	app.Name = "cxtool"
	app.Usage = "Utility to convert CX JSON into many other formats."
	app.Version = "0.1.0"

	app.Flags = []cli.Flag{
		cli.StringFlag{
			Name:  "source, s",
			Value: "source.cx",
			Usage: "Source file to be converted.",
		},

		cli.StringFlag{
			Name:  "format, f",
			Value: "cx",
			Usage: "Source file format.  Default input file format is CX.",
		},
	}

	app.Action = func(c *cli.Context) {
		commandLineArgs := c.Args()

		inFileFormat := c.String("format")
		if inFileFormat == "" {
			inFileFormat = cx
		}

		con := getCoverter(inFileFormat)

		// Two cases: Run from file or piped text stream
		if len(commandLineArgs) == 0 {
			con.ConvertFromStdin()
		} else {
			source := commandLineArgs[0]<commit_msg>Version number set to 0.2.0.<commit_after>package appbuilder

import (
	"github.com/codegangsta/cli"
	"github.com/idekerlab/cxtool/converter"
)

// File formats
const (
	csv = "csv"
	tsv = "tsv"
	cx = "cx"
	sif = "sif"
	cytoscapejs = "cyjs"
)

func BuildApp() *cli.App {
	app := cli.NewApp()
	app.Name = "cxtool"
	app.Usage = "Utility for CX files."
	app.Version = "0.2.0"

	app.Flags = []cli.Flag{
		cli.StringFlag{
			Name:  "format, f",
			Value: "cx",
			Usage: "Source file format.  Default input file format is CX.",
		},
	}

	app.Action = func(c *cli.Context) {
		commandLineArgs := c.Args()

		inFileFormat := c.String("format")
		if inFileFormat == "" {
			inFileFormat = cx
		}

		con := getCoverter(inFileFormat)

		// Two cases: Run from file or piped text stream
		if len(commandLineArgs) == 0 {
			con.ConvertFromStdin()
		} else {
			source := commandLineArgs[0]
{'fraction_non_alphanumeric': 0.15311004784688995, 'fraction_numerical': 0.006911217437533227, 'mean_word_length': 3.1822222222222223, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6057047', 'n_tokens_mistral': 795, 'n_tokens_neox': 722, 'n_words': 178}