#!/usr/bin/env python # coding: utf-8 import unittest from segmentation import * class SegmentationTests(unittest.TestCase): """ Tests for word segmentation functions. """ def test_split_pairs(self): self.assertEquals(len(split_pairs("hello")), 5) self.assertEquals(split_pairs("hi"), [("h", "i"), ("hi", "")]) self.assertEquals(split_pairs("yay"), [("y", "ay"), ("ya", "y"), ("yay", "")])