Unable to add synonyms through TrainingData class and Synonym parser

Hello. I am working on a NLU model. I want to write a code similar to RASAYamlWriter but I want it to include the list of synonyms that I have. I already have the utterances and they are labeled but I want to have code that creates a nlu.yml file from my training data and the synonym list. Thanks,