def test4_104111(self): token = "appirate_utils_message_before_appname" actual = preprocess(token, '104111') self.assertEqual([ws, 'app', 'ir', 'ate', '_', 'utils', '_', 'message', '_', 'before', '_', 'app', 'name', we], actual)
def test11_104111(self): token = "HTTP_1_0_noConnectionHeaderTest" actual = preprocess(token, '104111') self.assertEqual( [ws, caps, 'http', '_', '1', '_', '0', '_', 'no', cap, 'connection', cap, 'header', cap, 'test', we], actual)
def test8_104111(self): token = "__INCULDED_TEMPLATE_CLASS_NAME_LIST__" actual = preprocess(token, '104111') self.assertEqual( [ws, '_', '_', caps, 'inc', 'ul', 'ded', '_', caps, 'template', '_', caps, 'class', '_', caps, 'name', '_', caps, 'list', '_', '_', we], actual)
def __predict(self, input: str, do_preprocessing: bool) -> None: if do_preprocessing: prep_input = preprocess(input, self._repr) input = " ".join(prep_input) print("====================================") print(input) print("====================================") if self._backwards: input_lst = input.split(" ") input_lst.reverse() input = " ".join(input_lst) probs, labels = get_predictions(self._learner.model, self._text_field, [input], self._n_predictions) formatted_predictions = format_predictions(probs, labels, self._output_field, None) print(formatted_predictions)
def gen(): with open(path_to_file, 'r') as f: identifiers = [line.rstrip('\n') for line in f] csv_lines = [ DELIMITER.join(["config"] + [p for p in PrepParam] + identifiers) ] for prep in prep_configs: csv_line = [prep] for p in PrepParam: csv_line.append(PrepConfig.human_readable_values[p][ PrepConfig.from_encoded_string(prep).get_param_value(p)]) for identifier in identifiers: tokens = preprocess(identifier, prep) csv_line.append(' '.join(tokens)) csv_lines.append(DELIMITER.join(csv_line)) with open(path_to_file_out, 'w') as f: for line in csv_lines: f.write(f'{line}\n')
def test10_104111(self): token = "_407_PROXY_AUTH_REQUIRED" actual = preprocess(token, '104111') self.assertEqual([ws, '_', '4', '07', '_', caps, 'proxy', '_', caps, 'auth', '_', caps, 'required', we], actual)
def test9_104111(self): token = "cmd_reloadquestconfig" actual = preprocess(token, '104111') self.assertEqual([ws, 'cmd', '_', 'reload', 'quest', 'config', we], actual)
def test7_104111(self): token = "IImplicitRenderArgProvider" actual = preprocess(token, '104111') self.assertEqual([ws, caps, 'i', cap, 'implicit', cap, 'render', cap, 'arg', cap, 'provider', we], actual)
def test6_104111(self): token = "PERSISTENCE_BUNDLE_A" actual = preprocess(token, '104111') self.assertEqual([ws, caps, 'persistence', '_', caps, 'bundle', '_', caps, 'a', we], actual)
def test1_101110(self): token = "hideSoftInputFromWindow" actual = preprocess(token, '101110') self.assertEqual([ws, 'hide', 'Soft', 'Input', 'From', 'Window', we], actual)
def test3_104111(self): token = "LAYOUT_INFLATER_SERVICE" actual = preprocess(token, '104111') self.assertEqual([ws, caps, 'layout', '_', caps, 'inflater', '_', caps, 'service', we], actual)
def test2_104111(self): token = "_currentReaderVersion" actual = preprocess(token, '104111') self.assertEqual([ws, '_', 'current', cap, 'reader', cap, 'version', we], actual)
def test1_104111(self): token = "hideSoftInputFromWindow" actual = preprocess(token, '104111') self.assertEqual([ws, 'hide', cap, 'soft', cap, 'input', cap, 'from', cap, 'window', we], actual)
def test3_101110(self): token = "LAYOUT_INFLATER_SERVICE" actual = preprocess(token, '101110') self.assertEqual([ws, 'LAYOUT', '_', 'INFLATER', '_', 'SERVICE', we], actual)
def test1_000000(self): token = "hideSoftInputFromWindow" actual = preprocess(token, '000000') self.assertEqual(['hideSoftInputFromWindow'], actual)
def test2_101110(self): token = "_currentReaderVersion" actual = preprocess(token, '101110') self.assertEqual([ws, '_', 'current', 'Reader', 'Version', we], actual)
def test5_104111(self): token = "MalformedURLException" actual = preprocess(token, '104111') self.assertEqual([ws, cap, 'malformed', caps, 'url', cap, 'exception', we], actual)
def test12_104111(self): token = "f4_impact_1_original" actual = preprocess(token, '104111') self.assertEqual([ws, 'f', '4', '_', 'imp', 'act', '_', '1', '_', 'original', we], actual)