From 60fbbbbfc1c1f77f8d3665b72e6e35008a39d5a5 Mon Sep 17 00:00:00 2001 From: Grant Jenks Date: Sun, 3 Jan 2021 21:40:07 -0800 Subject: [PATCH] Bug fix for handling trigrams When "this" is the middle of a trigram, it should record the previous symbol in the digram index. --- javascript/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/main.js b/javascript/main.js index 133d816..9a9377f 100644 --- a/javascript/main.js +++ b/javascript/main.js @@ -113,7 +113,7 @@ Symbol.prototype.join = function(right) { if (this.prev && this.next && this.value() == this.next.value() && this.value() == this.prev.value()) { - digramIndex[this.hashValue()] = this; + digramIndex[this.prev.hashValue()] = this.prev; } } this.next = right;