diff --git a/src/jit_bayes b/src/jit_bayes index 4d47183..4f643e8 100755 Binary files a/src/jit_bayes and b/src/jit_bayes differ diff --git a/src/jit_bayes.nim b/src/jit_bayes.nim index af88026..1c0ae83 100644 --- a/src/jit_bayes.nim +++ b/src/jit_bayes.nim @@ -1,6 +1,7 @@ +import print import strutils import sequtils -import print +import std/sugar ## Get sequences let file_path = "../data/stripped" @@ -40,6 +41,17 @@ proc getSequencesWithStart(seqs: seq[seq[string]], start: seq[string]): seq[seq[ ## Pretty print sequences -var start = @["1", "2", "3"] -var continuations = getSequencesWithStart(seqs, start) -print continuations +# var start = @["1", "2", "3", "4", "5"] +# var continuations = getSequencesWithStart(seqs, start) +# print continuations + +## Do simple predictions +proc predictContinuation(seqs: seq[seq[string]], start: seq[string]): seq[string] = + let continuations = getSequencesWithStart(seqs, start) + let l = start.len + let next_items = continuations.map(c => c[l]) + return next_items + +var start = @["1", "2", "3", "4", "5"] +let sample_continuations = predictContinuation(seqs, start) +print(sample_continuations) diff --git a/src/makefile b/src/makefile new file mode 100644 index 0000000..ce35050 --- /dev/null +++ b/src/makefile @@ -0,0 +1,17 @@ +SHELL := /bin/bash ## <= required to use time +VERBOSE=--verbosity:0 + +build: jit_bayes.nim + nim c $(VERBOSE) jit_bayes.nim + +run: jit_bayes + ./jit_bayes $(VERBOSE) + +examine: jit_bayes + nim c $(VERBOSE) jit_bayes.nim && time ./jit_bayes $(VERBOSE) && echo + nim c $(VERBOSE) -d:release jit_bayes.nim && time ./jit_bayes $(VERBOSE) && echo + nim c $(VERBOSE) -d:danger jit_bayes.nim && time ./jit_bayes $(VERBOSE) + +time: + time make && echo && time make run +