Skip to content

Commit c39ae43

Browse files
committed
[minor refactor] Rename variables including allocator name
1 parent 954e983 commit c39ae43

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/MorphologicalLocate.cpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,13 +2286,13 @@ void explore_dic_in_morpho_mode(struct locate_parameters* p, int pos,
22862286

22872287
/**
22882288
* Tries to find something in the dictionary that match both text content and
2289-
* given pattern. This version of the function handles the all languages but Arabic.
2289+
* given pattern. This version of the function handles all languages but Arabic.
22902290
*/
22912291
void explore_dic_in_morpho_mode_standard_with_token(
22922292
struct locate_parameters* p,
22932293
Dictionary* d,
22942294
int offset,
2295-
const unichar* current_token,
2295+
const unichar* token,
22962296
unichar* inflected,
22972297
int pos_in_current_token,
22982298
int pos_in_inflected,
@@ -2318,7 +2318,7 @@ offset=read_dictionary_state(d,offset,&is_final_state,&n_transitions,&inf_number
23182318
inflected[pos_in_inflected] = '\0';
23192319
if (pattern == NULL && !save_dic_entry) {
23202320
/* If any word will do with no entry saving */
2321-
if (current_token[pos_in_current_token] == '\0') {
2321+
if (token[pos_in_current_token] == '\0') {
23222322
(*matches) = insert_morphological_match(-1,
23232323
pos_in_current_token, -1, (*matches), NULL, jamo,
23242324
pos_in_jamo, &p->al.pa);
@@ -2328,7 +2328,7 @@ offset=read_dictionary_state(d,offset,&is_final_state,&n_transitions,&inf_number
23282328

23292329

23302330
Abstract_allocator explore_dic_in_morpho_mode_standard_abstract_allocator=NULL;
2331-
explore_dic_in_morpho_mode_standard_abstract_allocator=create_abstract_allocator("explore_dic_in_morpho_mode_standard",
2331+
explore_dic_in_morpho_mode_standard_abstract_allocator=create_abstract_allocator("explore_dic_in_morpho_mode_standard_with_token",
23322332
AllocatorFreeOnlyAtAllocatorDelete|AllocatorTipGrowingOftenRecycledObject,
23332333
0);
23342334

@@ -2345,7 +2345,7 @@ offset=read_dictionary_state(d,offset,&is_final_state,&n_transitions,&inf_number
23452345
|| is_entry_compatible_with_pattern(dela_entry,
23462346
pattern))) {
23472347
//error("et ca matche!!\n");
2348-
if (current_token[pos_in_current_token] == '\0') {
2348+
if (token[pos_in_current_token] == '\0') {
23492349
(*matches) = insert_morphological_match(-1,
23502350
pos_in_current_token, -1, (*matches),
23512351
save_dic_entry ? dela_entry : NULL, jamo,
@@ -2369,12 +2369,12 @@ offset=read_dictionary_state(d,offset,&is_final_state,&n_transitions,&inf_number
23692369
int adr;
23702370
for (int i = 0; i < n_transitions; ++i) {
23712371
offset=read_dictionary_transition(d,offset,&c,&adr,ustr);
2372-
if (is_equal_or_uppercase(c, current_token[pos_in_current_token], p->alphabet)) {
2372+
if (is_equal_or_uppercase(c, token[pos_in_current_token], p->alphabet)) {
23732373
// If the transition's letter is case compatible with the current letter
23742374
// of the word to analyze, copy it in inflected and follow it
23752375
inflected[pos_in_inflected] = c;
23762376
explore_dic_in_morpho_mode_standard_with_token(p, d, adr,
2377-
current_token, inflected, pos_in_current_token + 1,
2377+
token, inflected, pos_in_current_token + 1,
23782378
pos_in_inflected + 1, matches, pattern,
23792379
save_dic_entry, jamo, pos_in_jamo, line_buffer, ustr, base);
23802380
}
@@ -2385,6 +2385,7 @@ offset=read_dictionary_state(d,offset,&is_final_state,&n_transitions,&inf_number
23852385
// if the loaded morphological dictionaries are 0=zaz, 1=bar and 2=foo; and
23862386
// if morpho_dic_list == "foo;zaz" then morpho_dic_indices = {2, 0}; or
23872387
// if morpho_dic_list == "*" then morpho_dic_indices = {0, 1, 2}
2388+
// @author Cristian Martinez
23882389
void get_morphological_dictionaries_indices(const char* morpho_dic_list,
23892390
const struct locate_parameters* p,
23902391
struct list_int* *morpho_dic_indices) {
@@ -2398,7 +2399,7 @@ void get_morphological_dictionaries_indices(const char* morpho_dic_list,
23982399
return;
23992400
}
24002401

2401-
char name[FILENAME_MAX];
2402+
char name[UNITEX_FULLPATH_MAX];
24022403
int pos = 0;
24032404
int index = -1;
24042405

@@ -2428,6 +2429,8 @@ void get_morphological_dictionaries_indices(const char* morpho_dic_list,
24282429
* This function tries to find something in p's morphological dictionary that
24292430
* matches the given token and pattern. If 'pattern' is NULL, anything found
24302431
* in the dictionary will do. It is used to represent the <DIC> pattern.
2432+
* @see explore_dic_in_morpho_mode_standard()
2433+
* @author Cristian Martinez
24312434
*/
24322435
void explore_dic_in_morpho_mode_with_token(
24332436
struct locate_parameters* p,
@@ -2442,11 +2445,11 @@ void explore_dic_in_morpho_mode_with_token(
24422445
unichar* buffer_line_buffer_inflected = (unichar*) malloc(sizeof(unichar) * (4096 + DIC_LINE_SIZE));
24432446

24442447
if (buffer_line_buffer_inflected == NULL) {
2445-
fatal_alloc_error("explore_dic_in_morpho_mode");
2448+
fatal_alloc_error("explore_dic_in_morpho_mode_with_token");
24462449
}
24472450

24482451
unichar* inflected = buffer_line_buffer_inflected;
2449-
Ustring* line_buffer=new_Ustring(4096);
2452+
Ustring* line_buffer=new_Ustring(DIC_LINE_SIZE);
24502453
Ustring* ustr=new_Ustring();
24512454

24522455
struct list_int* morpho_dic_indices = NULL;

0 commit comments

Comments
 (0)