Skip to content

Commit

Permalink
Test typescript version, not passing
Browse files Browse the repository at this point in the history
  • Loading branch information
Géry Casiez committed May 9, 2024
1 parent f192a3f commit c02bacf
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 8 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
all: testcplusplus
all: testcplusplus testTypescript

# C++ version original
testcplusplus:
cd cpp ; make Makefilecpp


# Typescript
testTypescript:
cd typescript ; make
2 changes: 1 addition & 1 deletion cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ int main(int argc, char* argv[]){
string s = value.substr(0,value.length()-1);
InputEvent e = predict(ts, x, y, s);
fileO << ts << "," << x << "," << y << "," << s << "," << e.x << "," << e.y << endl;
cout << "{x:" << x << ", y:" << y << ", s: \"" << s << "\", xp:" << e.x << ", yp:" << e.y << "}, ";
//cout << "{x:" << x << ", y:" << y << ", s: \"" << s << "\", xp:" << e.x << ", yp:" << e.y << "}, ";
}
cout << endl;
fileO.close();
Expand Down
5 changes: 4 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
print("%s does not exist"%args.filename, file=sys.stderr)
sys.exit()

df = pandas.read_csv('strokesPredicted64GroundTruth.csv')
try:
df = pandas.read_csv('strokesPredicted64GroundTruth.csv')
except:
df = pandas.read_csv('../strokesPredicted64GroundTruth.csv')
df2 = pandas.read_csv(args.filename)

problem = False
Expand Down
7 changes: 7 additions & 0 deletions typescript/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PYTHON=python3

all:
npm install ; \
tsc ; \
node dist/test.js > test.csv ; \
$(PYTHON) ../test.py typescript test.csv
2 changes: 1 addition & 1 deletion typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"latency"
],
"devDependencies": {
"@types/node": "^20.8.3"
"@types/node": "^20.12.11"
},
"dependencies": {
"1eurofilter": "^1.2.1"
Expand Down
22 changes: 19 additions & 3 deletions typescript/src/test.ts

Large diffs are not rendered by default.

0 comments on commit c02bacf

Please sign in to comment.