# Path: operators/hyphenator/get_dictionary.py
# def get_dictionary(dic_path=None, lang='en-us'):
#     """Collect the words from the default dictionary"""
# 
#     if dic_path == None:
#         module_path = os.path.dirname(__file__)
#         dic_path = os.path.join(module_path, 'dictionaries', lang + '.txt')
# 
#     dictionary = {}
# 
#     try:
#         f = open(dic_path, 'r')
#         lines = f.readlines()
#         f.close()
# 
#         for line in lines:
#             word = line.rstrip().replace(' ', '')
#             dictionary[word] = line.rstrip()
# 
#     except FileNotFoundError:
#         dictionary = {}
# 
#     return dictionary


import bpy
import os
from .hyphenator.get_dictionary import get_dictionary

class SEQUENCER_OT_save_syllables(bpy.types.Operator):
    bl_label = 'Save'
    bl_idname = 'sequencerextra.save_syllables'
    bl_description = "Add the syllables to the default syllable dictionary"

    @classmethod
    def poll(self, context):
        scene = context.scene
        path = bpy.path.abspath(scene.syllable_dictionary_path)

        if os.path.isfile(path):
            return True
        else:
            return False

    def execute(self, context):
        scene = context.scene

# Path: operators/hyphenator/get_dictionary.py
# def get_dictionary(dic_path=None, lang='en-us'):
#     """Collect the words from the default dictionary"""
# 
#     if dic_path == None:
#         module_path = os.path.dirname(__file__)
#         dic_path = os.path.join(module_path, 'dictionaries', lang + '.txt')
# 
#     dictionary = {}
# 
#     try:
#         f = open(dic_path, 'r')
#         lines = f.readlines()
#         f.close()
# 
#         for line in lines:
#             word = line.rstrip().replace(' ', '')
#             dictionary[word] = line.rstrip()
# 
#     except FileNotFoundError:
#         dictionary = {}
# 
#     return dictionary


# Path: operators/save_syllables.py
import bpy
import os
from .hyphenator.get_dictionary import get_dictionary


class SEQUENCER_OT_save_syllables(bpy.types.Operator):
    bl_label = 'Save'
    bl_idname = 'sequencerextra.save_syllables'
    bl_description = "Add the syllables to the default syllable dictionary"

    @classmethod
    def poll(self, context):
        scene = context.scene
        path = bpy.path.abspath(scene.syllable_dictionary_path)

        if os.path.isfile(path):
            return True
        else:
            return False

    def execute(self, context):
        scene = context.scene

        dictionary = get_dictionary(