Esempio n. 1
0
def validate_dictionary(folder=DICTIONARY_FOLDER):
    try:
        Dictionary.load(folder=folder, use_cache=False)
        return True
    except Exception as e:
        print(e.__repr__(), file=sys.stderr)
        return False
 def setUp(self):
     self.d = Dictionary.load()
     self.rand_gen = RandomPoolIEMLObjectGenerator(self.d, level=Theory)
Esempio n. 3
0
    parser = argparse.ArgumentParser(
        description='Generate the dictionary static website.')

    parser.add_argument('output_folder',
                        type=str,
                        help='the website output folder')
    parser.add_argument('base_url', type=str, help='the website base url')

    parser.add_argument('--dictionary-folder',
                        type=str,
                        required=False,
                        default=DICTIONARY_FOLDER,
                        help='the dictionary definition folder')

    parser.add_argument('--lexicon-folder',
                        type=str,
                        required=False,
                        default=LEXICONS_FOLDER,
                        help='the lexicons definition folder')

    args = parser.parse_args()

    dictionary = Dictionary.load(args.dictionary_folder)
    lexicon = Lexicon.load(args.lexicon_folder)

    generate_script_site(dictionary,
                         lexicon,
                         args.output_folder,
                         base_url=args.base_url)