# Path: cjktools/kana_table.py
# class KanaTable(object):
#     def __init__(self):
#     def _build_dicts(self):
#     def get_coords(self, kana):
#     def from_coords(self, consonant, vowel):
#     def to_vowel_line(self, kana):
#     def to_consonant_line(self, kana):
#     def is_voiced(self, kana):
#     def is_semivoiced(self, kana):
#     def get_table(self):
#     def get_cached(cls):
#     def __repr__(self):
# 
# Path: cjktools/scripts.py
# class Script(Enum):
# class ScriptMapping:
#     def __init__(self, from_script, to_script):
#     def __call__(self, j_string):
# def normalize_ascii(j_string):
# def normalize_kana(j_string):
# def normalize(j_string):
# def get_script(script):
# def compare_kana(j_string_a, j_string_b):
# def contains_script(script, j_string):
# def script_type(char):
# def script_boundaries(j_string):
# def script_types(j_string):
# def unique_kanji(j_string):
# 
# Path: cjktools/maps.py
# def chain_mapping(*dictionaries):
# def invert_mapping(dictionary):
# def is_injective(dictionary):
# def invert_injective_mapping(dictionary):
# def map_dict(method, dictionary, in_place=False):
# def multi_dict(input_pairs):
# def procmap(method, item_list):
# def merge_dicts(*args):
# def partial_map(method, object_seq):
# def filtered_map(method, object_list):


from cjktools import kana_table
from cjktools import scripts
from cjktools import maps
from six import unichr as chr
from six import iteritems
from itertools import product
import re

        >>> k = insert_duplicate_kanji(u'私々')
        >>> expected = u'私私'
        >>> k == expected
        True
    """
    loc = kanji_string.find('々')
    while loc > 0:
        dup = kanji_string[loc-1]
        kanji_string = kanji_string[:loc] + dup + kanji_string[loc+1:]
        loc = kanji_string.find('々')

    return kanji_string


_long_finder = re.compile(r'(?<=[\u3041-\u3096])ー')  # Finds only in hiragana


def expand_long_vowels(kana_string):
    """
    Expands whatever long vowels are possible to expand.

        >>> a = expand_long_vowels(u'すー')
        >>> b = u'すう'
        >>> a == b
        True
    """
    script_converters = {scripts.Script.Hiragana: lambda x: x,
                         scripts.Script.Katakana: scripts.to_katakana}


# Path: cjktools/kana_table.py
# class KanaTable(object):
#     def __init__(self):
#     def _build_dicts(self):
#     def get_coords(self, kana):
#     def from_coords(self, consonant, vowel):
#     def to_vowel_line(self, kana):
#     def to_consonant_line(self, kana):
#     def is_voiced(self, kana):
#     def is_semivoiced(self, kana):
#     def get_table(self):
#     def get_cached(cls):
#     def __repr__(self):
# 
# Path: cjktools/scripts.py
# class Script(Enum):
# class ScriptMapping:
#     def __init__(self, from_script, to_script):
#     def __call__(self, j_string):
# def normalize_ascii(j_string):
# def normalize_kana(j_string):
# def normalize(j_string):
# def get_script(script):
# def compare_kana(j_string_a, j_string_b):
# def contains_script(script, j_string):
# def script_type(char):
# def script_boundaries(j_string):
# def script_types(j_string):
# def unique_kanji(j_string):
# 
# Path: cjktools/maps.py
# def chain_mapping(*dictionaries):
# def invert_mapping(dictionary):
# def is_injective(dictionary):
# def invert_injective_mapping(dictionary):
# def map_dict(method, dictionary, in_place=False):
# def multi_dict(input_pairs):
# def procmap(method, item_list):
# def merge_dicts(*args):
# def partial_map(method, object_seq):
# def filtered_map(method, object_list):


# Path: cjktools/alternations.py
from cjktools import kana_table
from cjktools import scripts
from cjktools import maps
from six import unichr as chr
from six import iteritems
from itertools import product
import re


        >>> k = insert_duplicate_kanji(u'私々')
        >>> expected = u'私私'
        >>> k == expected
        True
    """
    loc = kanji_string.find('々')
    while loc > 0:
        dup = kanji_string[loc-1]
        kanji_string = kanji_string[:loc] + dup + kanji_string[loc+1:]
        loc = kanji_string.find('々')

    return kanji_string


_long_finder = re.compile(r'(?<=[\u3041-\u3096])ー')  # Finds only in hiragana


def expand_long_vowels(kana_string):
    """
    Expands whatever long vowels are possible to expand.

        >>> a = expand_long_vowels(u'すー')
        >>> b = u'すう'
        >>> a == b
        True
    """
    script_converters = {scripts.Script.Hiragana: lambda x: x,
                         scripts.Script.Katakana: scripts.to_katakana}


    table = kana_table.KanaTable.get_cached()