Fix stop criterion for getting collocates
Change-Id: I3e934a805f7ac91a47f7122c8b802d1397b2aec0
diff --git a/src/DerekoVecs.jl b/src/DerekoVecs.jl
index ae728c2..e71d01e 100644
--- a/src/DerekoVecs.jl
+++ b/src/DerekoVecs.jl
@@ -198,9 +198,11 @@
end
i = 0
- for c in unsafe_wrap(Vector{collocate}, res, max, own=false)
+ unsafe_array = unsafe_wrap(Vector{collocate}, res, max, own=false)
+ window = unsafe_array[1].window
+ for c in unsafe_array
i += 1
- if (c.w2 <= 0 || c.w2 > max_vocab_index || c.f2 <= 1 || c.pmi < 0.01)
+ if (c.w2 < 0 || c.w2 > max_vocab_index || c.window != window)
i -= 1
break
end