Package medite :: Package MediteAppli :: Package test :: Module testHMM
[hide private]
[frames] | no frames]

Source Code for Module medite.MediteAppli.test.testHMM

 1  # -*- coding: iso-8859-1 -*- 
 2  # Copyright 20003 - 2008: Julien Bourdaillet (julien.bourdaillet@lip6.fr), Jean-Gabriel Ganascia (jean-gabriel.ganascia@lip6.fr) 
 3  # This file is part of MEDITE. 
 4  # 
 5  #    MEDITE is free software; you can redistribute it and/or modify 
 6  #    it under the terms of the GNU General Public License as published by 
 7  #    the Free Software Foundation; either version 2 of the License, or 
 8  #    (at your option) any later version. 
 9  # 
10  #    MEDITE is distributed in the hope that it will be useful, 
11  #    but WITHOUT ANY WARRANTY; without even the implied warranty of 
12  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
13  #    GNU General Public License for more details. 
14  # 
15  #    You should have received a copy of the GNU General Public License 
16  #    along with Foobar; if not, write to the Free Software 
17  #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
18   
19   
20  import feng,unittest,os,sys 
21  from feng import * 
22   
23   
24 -class testFeng(unittest.TestCase):
25 """Teste la classe algoFeng defeng.py """
26 - def setUp(self):
27 28 self.txt1 = self.__lireFichier("txt/final.fr.txt") 29 self.txt2 = self.__lireFichier("txt/final-en2fr.txt")
30
31 - def __lireFichier(self,nom):
32 loc=os.path.join(os.getcwd(),nom) 33 f = open(loc) 34 res = f.read() 35 f.close() 36 return res
37
38 - def testAligne(self):
39 f = algoFeng(self.txt1,self.txt2) 40 f.aligne()
41 42 if __name__ == '__main__': 43 unittest.main() 44