Blame view

fsabuilder/morfeuszbuilder/segrules/test/preprocessorTest.py 741 Bytes
Michał Lenart authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'''
Created on 18 lut 2014

@author: mlenart
'''
import unittest
import codecs
import os

from morfeuszbuilder.segrules import preprocessor
from morfeuszbuilder.utils import configFile


class Test(unittest.TestCase):


    def testPreprocess(self):
        filename = os.path.join(os.path.dirname(__file__), 'segmenty.dat')
Michał Lenart authored
19
        parsedFile = configFile.ConfigFile(filename, ['options', 'combinations', 'tags', 'lexemes', 'segment types'])
Michał Lenart authored
20
21
22
23
24
25
26
27
        linesEnum = parsedFile.enumerateLinesInSection('combinations')
        for lineNum, line in preprocessor.preprocess(linesEnum, ['extra', 'superextra']):
            print (lineNum, line)


if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testPreprocess']
    unittest.main()