File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 11CC = gcc
22# For older gcc, use -O3 or -O2 instead of -Ofast
3- CFLAGS = -lm -pthread -Ofast -march=native -funroll-loops -Wno-unused-result
3+ # CFLAGS = -lm -pthread -Ofast -march=native -funroll-loops -Wno-unused-result
4+ CFLAGS = -lm -pthread -Ofast -march=native -funroll-loops -Wall -Wextra -Wpedantic
45BUILDDIR := build
56SRCDIR := src
67
Original file line number Diff line number Diff line change 11// Tool to calculate word-word cooccurrence statistics
22//
3- // Copyright (c) 2014 The Board of Trustees of
3+ // Copyright (c) 2014, 2018 The Board of Trustees of
44// The Leland Stanford Junior University. All Rights Reserved.
55//
66// Licensed under the Apache License, Version 2.0 (the "License");
2828
2929#define TSIZE 1048576
3030#define SEED 1159241
31+ #define MAX_STRING_LENGTH 1000
32+
3133#define HASHFN bitwisehash
3234
33- static const int MAX_STRING_LENGTH = 1000 ;
3435typedef double real ;
3536
3637typedef struct cooccur_rec {
@@ -122,7 +123,7 @@ int get_word(char *word, FILE *fin) {
122123 int i = 0 , ch ;
123124 while (!feof (fin )) {
124125 ch = fgetc (fin );
125- if (ch == 13 ) continue ;
126+ if (ch == '\r' ) continue ;
126127 if ((ch == ' ' ) || (ch == '\t' ) || (ch == '\n' )) {
127128 if (i > 0 ) {
128129 if (ch == '\n' ) ungetc (ch , fin );
Original file line number Diff line number Diff line change 2929#define MAX_STRING_LENGTH 1000
3030#define TSIZE 1048576
3131#define SEED 1159241
32+
3233#define HASHFN bitwisehash
3334
3435typedef struct vocabulary {
You can’t perform that action at this time.
0 commit comments