diff options
-rw-r--r-- | src/storage/chewing_large_table.cpp | 5 | ||||
-rw-r--r-- | src/storage/chewing_large_table2.cpp | 5 | ||||
-rw-r--r-- | src/storage/phrase_index.cpp | 5 | ||||
-rw-r--r-- | src/storage/phrase_large_table2.cpp | 5 | ||||
-rw-r--r-- | src/storage/phrase_large_table3.cpp | 5 |
5 files changed, 25 insertions, 0 deletions
diff --git a/src/storage/chewing_large_table.cpp b/src/storage/chewing_large_table.cpp index 5716c5c..dccdc8e 100644 --- a/src/storage/chewing_large_table.cpp +++ b/src/storage/chewing_large_table.cpp @@ -669,8 +669,13 @@ bool ChewingLargeTable::load_text(FILE * infile, TABLE_PHONETIC_TYPE type) { size_t freq; while (!feof(infile)) { +#ifdef __APPLE__ + int num = fscanf(infile, "%255s %255[^ \t] %u %ld", + pinyin, phrase, &token, &freq); +#else int num = fscanf(infile, "%255s %255s %u %ld", pinyin, phrase, &token, &freq); +#endif if (4 != num) continue; diff --git a/src/storage/chewing_large_table2.cpp b/src/storage/chewing_large_table2.cpp index 194173b..0dc96f4 100644 --- a/src/storage/chewing_large_table2.cpp +++ b/src/storage/chewing_large_table2.cpp @@ -115,8 +115,13 @@ bool ChewingLargeTable2::load_text(FILE * infile, TABLE_PHONETIC_TYPE type) { size_t freq; while (!feof(infile)) { +#ifdef __APPLE__ + int num = fscanf(infile, "%255s %255[^ \t] %u %ld", + pinyin, phrase, &token, &freq); +#else int num = fscanf(infile, "%255s %255s %u %ld", pinyin, phrase, &token, &freq); +#endif if (4 != num) continue; diff --git a/src/storage/phrase_index.cpp b/src/storage/phrase_index.cpp index 06b613f..36cb149 100644 --- a/src/storage/phrase_index.cpp +++ b/src/storage/phrase_index.cpp @@ -527,8 +527,13 @@ bool FacadePhraseIndex::load_text(guint8 phrase_index, FILE * infile, phrase_token_t cur_token = 0; while (!feof(infile)){ +#ifdef __APPLE__ + int num = fscanf(infile, "%255s %255[^ \t] %u %ld", + pinyin, phrase, &token, &freq); +#else int num = fscanf(infile, "%255s %255s %u %ld", pinyin, phrase, &token, &freq); +#endif if (4 != num) continue; diff --git a/src/storage/phrase_large_table2.cpp b/src/storage/phrase_large_table2.cpp index 38dafb3..0e6fa62 100644 --- a/src/storage/phrase_large_table2.cpp +++ b/src/storage/phrase_large_table2.cpp @@ -472,8 +472,13 @@ bool PhraseLargeTable2::load_text(FILE * infile){ size_t freq; while (!feof(infile)) { +#ifdef __APPLE__ + int num = fscanf(infile, "%255s %255[^ \t] %u %ld", + pinyin, phrase, &token, &freq); +#else int num = fscanf(infile, "%255s %255s %u %ld", pinyin, phrase, &token, &freq); +#endif if (4 != num) continue; diff --git a/src/storage/phrase_large_table3.cpp b/src/storage/phrase_large_table3.cpp index 696c612..1e8fd76 100644 --- a/src/storage/phrase_large_table3.cpp +++ b/src/storage/phrase_large_table3.cpp @@ -128,8 +128,13 @@ bool PhraseLargeTable3::load_text(FILE * infile){ size_t freq; while (!feof(infile)) { +#ifdef __APPLE__ + int num = fscanf(infile, "%255s %255[^ \t] %u %ld", + pinyin, phrase, &token, &freq); +#else int num = fscanf(infile, "%255s %255s %u %ld", pinyin, phrase, &token, &freq); +#endif if (4 != num) continue; |