Blame view

fsabuilder/morfeuszbuilder/segrules/test.py 577 Bytes
Michał Lenart authored
1
2
3
4
5
6
'''
Created on 24 sty 2014

@author: mlenart
'''
Michał Lenart authored
7
from morfeuszbuilder.segrules import preprocessor
Michał Lenart authored
8
9
10
11
12
13
14
15

if __name__ == '__main__':
    text = '''
dupa
#define asd XXX
#define X(x) a x b
#define Y(x) X(x) c
#define B(x) X(x)
Michał Lenart authored
16
17
#define Z(x) Y( X(x) jhg) d
#define A_B(asd) dupa asd dupa asfda_asdfa
Michał Lenart authored
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Y(Z(a) b X(c) Y(d))
#ifdef extra
asdfasa
#ifdef extra
asdfasdfasdfa
#endif
#ifdef superextra
aaaa asd
#endif
#endif

#ifdef superextra
asdfasdfada
#endif
Michał Lenart authored
33
A_B( (x)+ x)
Michał Lenart authored
34
'''
Michał Lenart authored
35
    for line in preprocessor.preprocess(enumerate(text.split('\n')), ['extra', 'superextra']):
Michał Lenart authored
36
        print line