Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions word2phrase.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ unsigned long long next_random = 1;
void ReadWord(char *word, FILE *fin, char *eof) {
int a = 0, ch;
while (1) {
ch = fgetc_unlocked(fin);
ch = getc_unlocked(fin);
if (ch == EOF) {
*eof = 1;
break;
Expand Down Expand Up @@ -246,7 +246,7 @@ void TrainModel() {
if (eof) break;
if (word[0] == '\n') {
//fprintf(fo, "\n");
fputc_unlocked('\n', fo);
putc_unlocked('\n', fo);
continue;
}
cn++;
Expand Down Expand Up @@ -286,12 +286,12 @@ void TrainModel() {
next_random = next_random * (unsigned long long)25214903917 + 11;
//if (next_random & 0x10000) score = 0;
if (score > threshold) {
fputc_unlocked('_', fo);
putc_unlocked('_', fo);
pb = 0;
} else fputc_unlocked(' ', fo);
} else putc_unlocked(' ', fo);
a = 0;
while (word[a]) {
fputc_unlocked(word[a], fo);
putc_unlocked(word[a], fo);
a++;
}
pa = pb;
Expand Down
2 changes: 1 addition & 1 deletion word2vec.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void InitUnigramTable() {
void ReadWord(char *word, FILE *fin, char *eof) {
int a = 0, ch;
while (1) {
ch = fgetc_unlocked(fin);
ch = getc_unlocked(fin);
if (ch == EOF) {
*eof = 1;
break;
Expand Down