Skip to content

Commit

Permalink
Merge pull request #1484 from linas/dict-file
Browse files Browse the repository at this point in the history
Move file-dictionary cursor data into file directory
  • Loading branch information
linas authored Mar 28, 2024
2 parents 611489f + c8655bd commit 6c64970
Show file tree
Hide file tree
Showing 5 changed files with 238 additions and 260 deletions.
12 changes: 1 addition & 11 deletions link-grammar/dict-common/dict-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,9 @@ struct Dictionary_s
Category * category; /* Word lists - indexed by category number */
bool generate_walls; /* Generate walls too for wildcard words */

/* Private data elements that come in play only while file-backed
* dictionaries are being read, and are not otherwise used.
* TODO: These should be moved to a private structure, accessible
* only to the file backend.
*/
const char * input;
const char * pin;
bool recursive_error;
bool is_special;
int already_got_it; /* For char, but needs to hold EOF */
/* File I/O cruft */
int line_number;
char current_idiom[IDIOM_LINK_SZ];
char token[MAX_TOKEN_LENGTH];
};

bool is_stem(const char *);
Expand Down
7 changes: 1 addition & 6 deletions link-grammar/dict-file/dictionary.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,8 @@ dictionary_six_str(const char * lang,
/*align*/false, /*exact*/false);

/* Read dictionary from the input string. */

dict->input = input;
dict->pin = dict->input;
if (!read_dictionary(dict))
{
if (!read_dictionary(dict, input))
goto failure;
}

if (NULL == affix_name)
{
Expand Down
Loading

0 comments on commit 6c64970

Please sign in to comment.