Home | Trees | Indices | Help |
|
---|
|
1 # Natural Language Toolkit 2 # 3 # Author: Sumukh Ghodke <sumukh dot ghodke at gmail dot com> 4 # 5 # URL: <http://nltk.sf.net> 6 # This software is distributed under GPL, for license information see LICENSE.TXT 7 8 from nltk_lite.contrib.classifier import cfile, item, format 9 from nltk_lite.contrib.classifier_tests import * 103313 self.contents = "" 14 f = cfile.File(datasetsDir(self) + 'test_phones' + SEP + 'phoney', format.C45_FORMAT.NAMES) 15 f.for_each_line(self.printline) 16 17 verificationContents = "" 18 check = open(datasetsDir(self) + 'test_phones' + SEP + 'phoney.names', 'r') 19 for l in check: 20 verificationContents += l 21 self.assertEqual(verificationContents, self.contents)2224 basename, extension = cfile.name_extension('/home/something.something/else/test_phones' + SEP + 'phoney.' + format.C45_FORMAT.NAMES) 25 self.assertEqual('/home/something.something/else/test_phones/phoney', basename) 26 self.assertEqual('names', extension)27 3032 self.contents += l + '\n' # the \n is to simulate a new line
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Wed May 16 22:47:41 2007 | http://epydoc.sourceforge.net |