# Path: cjktools/alternations.py
# def canonical_forms(kana_segments):
# def canonical_segment_forms(segment, left_context=True, right_context=True):
# def surface_forms(reading_segments):
# def rendaku_variants(kana_segment):
# def onbin_variants(kana_segment):
# def _create_voicing_map():
# def insert_duplicate_kanji(kanji_string):
# def expand_long_vowels(kana_string):


import unittest
import doctest
from cjktools import alternations
from itertools import product
        result = set(alternations.canonical_segment_forms(voiced, True, False))
        self.assertEqual(result, expected)

        self.assertEqual(alternations.canonical_segment_forms('わ'),
                         set(['わ']))

    def test_canonical_segment_forms_doubling(self):
        doubled = 'さっ'

        actual = alternations.canonical_segment_forms(doubled, True, True)
        expected = {'さい', 'さき', 'さく', 'さち', 'さっ', 'さつ', 'さり'}

        self.assertEqual(actual, expected)

    def test_surface_forms(self):
        plan = ('けい', 'かく')
        expected = [('けい', 'がく'),
                    ('けい', 'かく'),
                    ('けっ', 'がく'),
                    ('けっ', 'かく')]

        self.assertEqual(set(alternations.surface_forms(plan)),
                         set(expected))

    def test_expand_long_vowels(self):
        # Skipping 'けー' and 'そー' unclear what to do there
        expected = ['すう', 'しい', 'かあ', ]
        long_vowels = ('すー', 'しー', 'かー', )

        for i, e in zip(long_vowels, expected):

# Path: cjktools/alternations.py
# def canonical_forms(kana_segments):
# def canonical_segment_forms(segment, left_context=True, right_context=True):
# def surface_forms(reading_segments):
# def rendaku_variants(kana_segment):
# def onbin_variants(kana_segment):
# def _create_voicing_map():
# def insert_duplicate_kanji(kanji_string):
# def expand_long_vowels(kana_string):


# Path: cjktools/tests/test_alternations.py
import unittest
import doctest
from cjktools import alternations
from itertools import product

        result = set(alternations.canonical_segment_forms(voiced, True, False))
        self.assertEqual(result, expected)

        self.assertEqual(alternations.canonical_segment_forms('わ'),
                         set(['わ']))

    def test_canonical_segment_forms_doubling(self):
        doubled = 'さっ'

        actual = alternations.canonical_segment_forms(doubled, True, True)
        expected = {'さい', 'さき', 'さく', 'さち', 'さっ', 'さつ', 'さり'}

        self.assertEqual(actual, expected)

    def test_surface_forms(self):
        plan = ('けい', 'かく')
        expected = [('けい', 'がく'),
                    ('けい', 'かく'),
                    ('けっ', 'がく'),
                    ('けっ', 'かく')]

        self.assertEqual(set(alternations.surface_forms(plan)),
                         set(expected))

    def test_expand_long_vowels(self):
        # Skipping 'けー' and 'そー' unclear what to do there
        expected = ['すう', 'しい', 'かあ', ]
        long_vowels = ('すー', 'しー', 'かー', )

        for i, e in zip(long_vowels, expected):

            out = alternations.expand_long_vowels(i)