(cls, args, **kwargs)
| 134 | |
| 135 | @classmethod |
| 136 | def setup_dictionary(cls, args, **kwargs): |
| 137 | dictionary = None |
| 138 | output_dictionary = None |
| 139 | if args.data: |
| 140 | paths = utils.split_paths(args.data) |
| 141 | assert len(paths) > 0 |
| 142 | dictionary = Dictionary.load(os.path.join(paths[0], "dict.txt")) |
| 143 | logger.info("dictionary: {} types".format(len(dictionary))) |
| 144 | output_dictionary = dictionary |
| 145 | if args.output_dictionary_size >= 0: |
| 146 | output_dictionary = TruncatedDictionary( |
| 147 | dictionary, args.output_dictionary_size |
| 148 | ) |
| 149 | return (dictionary, output_dictionary) |
| 150 | |
| 151 | @classmethod |
| 152 | def setup_task(cls, args, **kwargs): |
no test coverage detected