 $ = Annotator.$
 xpathRange = Annotator.Range
 Util = Annotator.Util
+
+
+`
+function HashTable() {
+    this.hashes = {};
+}
+
+HashTable.prototype = {
+    constructor: HashTable,
+
+    put: function( key, value ) {
+        this.hashes[ $(key).getPath() ] = value;
+    },
+
+    get: function( key ) {
+        return this.hashes[ $(key).getPath() ];
+    }
+};
+
+jQuery.fn.extend({
+    getPath: function () {
+        var path, node = this;
+        while (node.length) {
+            var realNode = node[0], name = realNode.localName;
+            if (!name) break;
+            name = name.toLowerCase();
+
+            var parent = node.parent();
+
+            var sameTagSiblings = parent.children(name);
+            if (sameTagSiblings.length > 1) {
+                allSiblings = parent.children();
+                var index = allSiblings.index(realNode) + 1;
+                if (index > 1) {
+                    name += ':nth-child(' + index + ')';
+                }
+            }
+
+            path = name + (path ? '>' + path : '');
+            node = parent;
+        }
+
+        return path;
+    }
+});
+`
+
 
 # This plugin implements the UI code for selecting sentences by clicking
 module.exports = class SentenceSelection extends Annotator.Plugin

        if desiredText == undefined
          # Just start in the next jump element without saving the current position in the document
          nextSibling = this.returnNext(currentTarget)
          this.currentIndex = 0
          this.currentSentence = 0
          this.selectSentence nextSibling
        else if desiredText.endsWith(".") or desiredText.endsWith("!") or desiredText.endsWith("?")

    # here want to test:
    # 1. is there a sibling element?
    # 2. is there a parent element with a next sibling?
    this.currentIndexes.put(currentTarget, 0)
    this.currentSentence = 0


    nextSibling = this.returnNext(currentTarget)

