# -*- coding: utf-8 -*-
#! python
from __future__ import with_statement

import os
import math

N_HEREST_PASSES = 20
PHONE_MAXLEN = 4000
PHONE_LEN0 = 8
PHONE_LEN1 = math.log(PHONE_MAXLEN/float(PHONE_LEN0))/N_HEREST_PASSES

def selected(info, whichpass):
	if info['_priority'] <= 1:
		return True
	if whichpass==0:
		return False
	if len(info['_phones']) > PHONE_LEN0 * math.exp((whichpass-1)*PHONE_LEN1):
		return False
	return "ASR" in info['metadatafile'] and not "English" in info['metadatafile']


IGNORE = ['Jamaicain_jm5_1/100528T1510/000004',
		'Punjabi_pm6_1/100528T1509/000002_0'
		]

def selected_VY(info, whichpass):
	df = os.path.join(info['d'], info['f'])
	for x in IGNORE:
		if x in df:
			return False
	return 2 < len(info['_phones']) < 30



