def save(self, path: pathlib.Path):
    'Saves words to a .csv file and structure to a .json.'
    self.words.to_csv(path.with_suffix('.csv'))
    with path.with_suffix('.json').open(mode='w') as f:
        f.write(json.dumps(self.structure))
Saves words to a .csv file and structure to a .json.
def save(self, path: pathlib.Path):
    
    self.words.to_csv(path.with_suffix('.csv'))
    with path.with_suffix('.json').open(mode='w') as f:
        f.write(json.dumps(self.structure))