Esempio n. 1
0
 def setUp(self):
     self.chint = categoryHinter()
     self.chint.addHint("Dues", "dues")
     self.ac111 = ambiguousCluster(ambiguousNumber("111", {}), None)
     self.ac222 = ambiguousCluster(ambiguousNumber("222", {}), None)
     self.ac333 = ambiguousCluster(ambiguousNumber("333", {}), None)
     self.ac444 = ambiguousCluster(ambiguousNumber("444", {}), None)
Esempio n. 2
0
 def setUp(self):
     self.ch = categoryHinter( os.path.join('config', 'test-categories.conf') )
     self.pe = penaltyEngine
     self.obj = incomeStatement( self.ch, self.pe )
     self.io = StringIO()
     self.io.write(type2string)
     self.io.seek(0)
Esempio n. 3
0
 def setUp(self):
     ch = categoryHinter( os.path.join('config', 'test-categories.conf') )
     bl = [type1Line( ' x 2007', ch )]
     bl.append( type1Line('', ch) )
     bl.append( type1Line('', ch) )
     bl.append( type1Line('', ch) )
     bl.append( type1Line('x 1. dues 10000', ch) )
     self.assumption = assumptionsList( bl )[0]
     self.assumption_spec = assumptionSpec()
     self.engine = penaltyEngine( self.assumption, self.assumption_spec )
Esempio n. 4
0
#!/usr/bin/python

import os,sys,re,csv
sys.path.append( os.getcwd() )
from renumerate.CategoryHint import categoryHinter
from renumerate.PenaltyEngine import penaltyEngine
from renumerate.IncomeStatement import incomeStatement
from renumerate.PursueTotals import assumptionSpec

spec = assumptionSpec()
ch = categoryHinter( 'config/test-jcategories.conf' )
pe = penaltyEngine

path='/home/bennett//Desktop/Work/Research/NPO-financials/financials/pdf/naikakufu/'

unpaper='unpaper -bn v,h -bs 3 -bd 100 -bp 2 -bt 0.9 -bi 0.95 -li 0.01 --overwrite --deskew-scan-step 0.05 --no-noisefilter --grayfilter-size 5 --grayfilter-step 1 --grayfilter-threshold 0.1'

filename = os.path.split( sys.argv[1] )[-1]
filename = os.path.splitext( filename )[0]
filename = filename.decode('utf8')
filename = filename.encode('utf8')

def analyze( text=None):
    if not text:
        text = open('RDATA.txt').read().decode('utf8')
    incomer = incomeStatement( ch, pe )
    incomer.read( text )
    incomer.analyze()
    data = []
    for section in ch.ordered_sections():
        data.append( [] )
Esempio n. 5
0
 def setUp(self):
     self.ch = categoryHinter( os.path.join('config', 'test-jcategories.conf') )
     self.pe = penaltyEngine
     self.obj = incomeStatement( self.ch, self.pe )
Esempio n. 6
0
 def setUp(self):
     self.chint = categoryHinter()
     self.chint.addHint('Dues','dues')
     self.chint.addHint('Dues','Membership Fee')
     self.chint.addHint('Projects','project')
Esempio n. 7
0
 def setUp(self):
     self.chint = categoryHinter()
     self.chint.addHint('Dues','dues')
Esempio n. 8
0
'''

import unittest
import os
import unittest,os,sys
sys.path.append( os.getcwd() )
from renumerate.Assumptions import assumptionsList
from renumerate.PursueTotals import assumptionSpec
from renumerate.Type1Line import type1Line
from renumerate.CategoryHint import categoryHinter

class testGA(assumptionsList):
    def __init__(self, biglist):
        pass

ch = categoryHinter()
ch.read( os.path.join('config', 'test-categories.conf') )

class TestSuite(unittest.TestCase):

    def setUp(self):
        self.bl = [type1Line( '1 2 3', ch )]
        self.ga = testGA( self.bl )
        self.ga.combination_limit = 100

    def testCondense(self):
        bl = [type1Line( '1 blah 2 blah 3 blah 4 blah 5', ch )]
        assumptions = assumptionsList( bl )
        spec = assumptionSpec()
        spec.mark_cruft(1)
        spec.mark_total(2)