示例#1
0
    def test_ngram(self):
        s = Sequencer()

        abc = s.id(('a', 'b', 'c'))
        bcd = s.id(('b', 'c', 'd'))

        self.assertEqual(1, abc)
        self.assertEqual(2, bcd)
        self.assertEqual(abc, s.id(('a', 'b', 'c')))
        self.assertEqual(bcd, s.id(('b', 'c', 'd')))
示例#2
0
    def test_basic(self):
        s = Sequencer()
        a = s.id('a')
        b = s.id('b')
        c = s.id('c')

        self.assertEqual(1, a)
        self.assertEqual(2, b)
        self.assertEqual(3, c)
        self.assertEqual(a, s.id('a'))
        self.assertEqual(b, s.id('b'))
        self.assertEqual(c, s.id('c'))