File size: 678 Bytes
21baa2f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# -*- coding: utf-8 -*-
'''
Created on ٠٢‏/٠٤‏/٢٠١٠

@Created by: Muhammad Altabba
'''
from Morphology.AffixParser import *
from Tokenization.Tokenizer import *

import codecs;



if __name__ == "__main__":
    
    f = codecs.open('../../Data/AffixParser_test.txt', 'r', 'utf-8');
    str = f.read();
    print('file encoding: ', f.encoding)
    f.close();
    tok = Tokenizer(str);
    
    ap = AffixParser(tok.Sentences);
    ap.ParsePrefix('../../Data/MorphologyTransducers/Proclitics.xml');
    ap.ParseSuffix('../../Data/MorphologyTransducers/Enclitics.xml');
    
    #Print
    print(tok); 
    print(tok.Sentences[0].Words[0].GetAffixationPosibilities());