<commit_before>import homedir = require('homedir')
import Log from './util/log'
import path = require('path')
import Web3 = require('web3')
import * as env from './env'

declare var web3: Web3 | undefined

const BASE_DIR = '.machinomy'
const COFNGIRATION_FILE = 'config.json'
const DATABASE_FILE = 'storage.db'
export const VERSION = '0.0.3'
export const PROTOCOL = 'machinomy/' + VERSION
export const PAYWALL_PATH = 'api/paywall/' + PROTOCOL

const log = Log('configuration')

const CONTRACTS = {
  development: '0xede26550428812f833ad7a8d1a9019561d243d6c',
  ropsten: '0xc582877dec917b21fa6b0dc68101b5c01f966325'
}

export const contractAddress = (): string => {
  const container = env.container()
  const network = container.MACHINOMY_NETWORK || 'ropsten'
  const address = container.CONTRACT_ADDRESS
  if (address) {
    return address
  } else {
    return (CONTRACTS as any)[network]
  }
}

export const baseDirPath = (): string => {
  return path.resolve(path.join(homedir(), BASE_DIR))
}

export const configFilePath = (): string => {
  return path.join(baseDirPath(), COFNGIRATION_FILE)
}

const databaseFilePath = (): string => {
  return path.join(baseDirPath(), DATABASE_FILE)
}

export interface IConfigurationOptions {
  account?: string
  password?: string
  engine?: string
  databaseUrl?: string
}

export class Configuration {<commit_msg>Fix of default db path string for CLI.<commit_after>import homedir = require('homedir')
import Log from './util/log'
import path = require('path')
import Web3 = require('web3')
import * as env from './env'

declare var web3: Web3 | undefined

const BASE_DIR = '.machinomy'
const COFNGIRATION_FILE = 'config.json'
const DATABASE_FILE = 'storage.db'
export const VERSION = '0.0.3'
export const PROTOCOL = 'machinomy/' + VERSION
export const PAYWALL_PATH = 'api/paywall/' + PROTOCOL

const log = Log('configuration')

const CONTRACTS = {
  development: '0xede26550428812f833ad7a8d1a9019561d243d6c',
  ropsten: '0xc582877dec917b21fa6b0dc68101b5c01f966325'
}

export const contractAddress = (): string => {
  const container = env.container()
  const network = container.MACHINOMY_NETWORK || 'ropsten'
  const address = container.CONTRACT_ADDRESS
  if (address) {
    return address
  } else {
    return (CONTRACTS as any)[network]
  }
}

export const baseDirPath = (): string => {
  return path.resolve(path.join(homedir(), BASE_DIR))
}

export const configFilePath = (): string => {
  return path.join(baseDirPath(), COFNGIRATION_FILE)
}

const databaseFilePath = (): string => {
  return 'nedb://' + path.join(baseDirPath(), DATABASE_FILE)
}

export interface IConfigurationOptions {
  account?: string
  password?: string
  engine?: string
  databaseUrl?: string
}

export class Configuration {
{'fraction_non_alphanumeric': 0.11813885859687387, 'fraction_numerical': 0.046528535078153396, 'mean_word_length': 4.892933618843683, 'pattern_counts': {'":': 0, '<': 3, '<?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': '117254', 'n_tokens_mistral': 995, 'n_tokens_neox': 935, 'n_words': 232}