Created
September 26, 2019 15:19
-
-
Save jwheat/9a2611b738127f45d32254117fe3b959 to your computer and use it in GitHub Desktop.
Rasa domain Assembler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import glob | |
import hiyapyco | |
path = 'data/domain' | |
yaml_list = [] | |
for filename in glob.glob(os.path.join(path, '*.yml')): | |
with open(filename) as fp: | |
yaml_file = fp.read() | |
yaml_list.append(yaml_file) | |
merged_yaml = hiyapyco.load(yaml_list, method=hiyapyco.METHOD_MERGE) | |
print(hiyapyco.dump(merged_yaml)) | |
domain_yml_file = open("domain.yml","w+") | |
domain_yml_file.writelines(hiyapyco.dump(merged_yaml)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment