unit tests for nltk corpus nombank load the nombank once no of instances no of rolesets no of nouns load the nombank once no of instances no of rolesets no of nouns
import unittest

from nltk.corpus import nombank


nombank.nouns()


class NombankDemo(unittest.TestCase):
    def test_numbers(self):
        
        self.assertEqual(len(nombank.instances()), 114574)
        
        self.assertEqual(len(nombank.rolesets()), 5577)
        
        self.assertEqual(len(nombank.nouns()), 4704)

    def test_instance(self):
        self.assertEqual(nombank.instances()[0].roleset, "perc-sign.01")

    def test_framefiles_fileids(self):
        self.assertEqual(len(nombank.fileids()), 4705)
        self.assertTrue(all(fileid.endswith(".xml") for fileid in nombank.fileids()))