[fix] Removing commented out section
This commit is contained in:
@@ -906,99 +906,6 @@ char *transliterate(char *trans_name, char *str) {
|
||||
|
||||
return str;
|
||||
|
||||
/*
|
||||
|
||||
while (idx < len) {
|
||||
char_len = utf8proc_iterate(char_ptr, len, &codepoint);
|
||||
if (char_len <= 0) {
|
||||
uint32_array_destroy(char_set);
|
||||
string_tree_destroy(tree);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(utf8proc_codepoint_valid(codepoint))) {
|
||||
idx += char_len;
|
||||
char_ptr += char_len;
|
||||
continue;
|
||||
}
|
||||
|
||||
add_to_index = true;
|
||||
|
||||
if (codepoint == LSQUARE_CODEPOINT && last_codepoint != BACKSLASH_CODEPOINT) {
|
||||
log_debug("begin set\n");
|
||||
in_set = true;
|
||||
add_to_index = false;
|
||||
uint32_array_clear(char_set);
|
||||
} else if (codepoint == RSQUARE_CODEPOINT && last_codepoint != BACKSLASH_CODEPOINT && in_set) {
|
||||
log_debug("end set");
|
||||
|
||||
for (j = 0; j < char_set->n; j++) {
|
||||
temp_char_len = utf8proc_encode_char(char_set->a[j], (uint8_t *)temp_char);
|
||||
log_debug("Adding string %.*s\n", temp_char_len, temp_char);
|
||||
string_tree_add_string_len(tree, temp_char, temp_char_len);
|
||||
}
|
||||
string_tree_finalize_token(tree);
|
||||
|
||||
uint32_array_clear(char_set);
|
||||
// Add a special codepoint to the sequence to distinguish from an escaped square bracket
|
||||
codepoint = END_SET_CODEPOINT;
|
||||
in_set = false;
|
||||
add_to_index = false;
|
||||
} else if (codepoint == LCURLY_CODEPOINT && last_codepoint != BACKSLASH_CODEPOINT) {
|
||||
in_brackets = true;
|
||||
bracket_start = idx + char_len;
|
||||
bracket_len = 0;
|
||||
} else if (codepoint == RCURLY_CODEPOINT && last_codepoint != BACKSLASH_CODEPOINT && in_brackets) {
|
||||
log_debug("Adding bracketed string: %.*s\n", regex + bracket_start, bracket_len);
|
||||
string_tree_add_string_len(tree, regex + bracket_start, bracket_len);
|
||||
in_brackets = false;
|
||||
} else if ((codepoint == LPAREN_CODEPOINT || codepoint == RPAREN_CODEPOINT) && last_codepoint != BACKSLASH_CODEPOINT) {
|
||||
log_debug("group\n");
|
||||
add_to_index = false;
|
||||
} else if (codepoint == STAR_CODEPOINT && last_codepoint != BACKSLASH_CODEPOINT) {
|
||||
log_debug("star\n");
|
||||
// For *, we add an optional transition to the empty
|
||||
codepoint = REPEAT_ZERO_CODEPOINT;
|
||||
} else if (codepoint == PLUS_CODEPOINT && last_codepoint != BACKSLASH_CODEPOINT) {
|
||||
log_debug("plus\n");
|
||||
codepoint = REPEAT_ONE_CODEPOINT;
|
||||
} else if (codepoint == DOLLAR_CODEPOINT && last_codepoint != BACKSLASH_CODEPOINT) {
|
||||
log_debug("dollar\n");
|
||||
codepoint = WORD_BOUNDARY_CODEPOINT;
|
||||
|
||||
if (in_set) {
|
||||
uint32_array_push(char_set, codepoint);
|
||||
add_to_index = false;
|
||||
}
|
||||
} else if (in_set) {
|
||||
log_debug("in set\n");
|
||||
// Queue node, we'll add them to the trie
|
||||
uint32_array_push(char_set, codepoint);
|
||||
add_to_index = false;
|
||||
} else if (in_brackets) {
|
||||
add_to_index = false;
|
||||
bracket_len += char_len;
|
||||
} else if (codepoint == BACKSLASH_CODEPOINT && last_codepoint != BACKSLASH_CODEPOINT) {
|
||||
add_to_index = false;
|
||||
}
|
||||
|
||||
log_debug("codepoint = %d\n", codepoint);
|
||||
|
||||
if (add_to_index) {
|
||||
temp_char_len = utf8proc_encode_char(codepoint, (uint8_t *)temp_char);
|
||||
log_debug("char = %.*s\n", temp_char_len, temp_char);
|
||||
string_tree_add_string_len(tree, temp_char, temp_char_len);
|
||||
string_tree_finalize_token(tree);
|
||||
}
|
||||
|
||||
idx += char_len;
|
||||
char_ptr += char_len;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
void transliteration_table_destroy(void) {
|
||||
|
||||
Reference in New Issue
Block a user