• Robert Knight's avatar
    Use new quote matching algorithm for quote anchoring · 2a1e14c9
    Robert Knight authored
    Use the new matching algorithm for anchoring text quote selectors. This
    is faster than the existing one when many quote selectors fail to exactly match
    and gives us more insight into and control over the fuzzy matching
    process.
    
     - Use the `matchQuote` function to do find the best match for the quote
       in the text, replacing the `dom-anchor-text-quote` library.
    
       This resolves a problem where the browser could become unresponsive
       for a significant period of time when anchoring large numbers of
       annotations (hundreds) on pages where there have been significant
       changes in the content.
    
       In the "Public" group on http://www.americanyawp.com/text/01-the-new-world/
       for example the client spends a total of ~2.4 seconds running JS in between starting
       the client and anchoring completing compared to ~11 seconds with the
       previous implementation.
    
       The new implementation also provides more control over the degree of
       mismatch between quote selector and document text that is allowed.
       The current settings provide higher recall (larger proportion of
       "correct" approximate matches found) than the previous
       implementation. On http://www.americanyawp.com/text/01-the-new-world/
       for example the number of orphans dropped from 137 to 63.
    
       Finally the new library is also smaller. The minified `annotator.bundle.js`
       size is reduced by 15% (25KB).
    
     - Change `TextQuoteAnchor.fromSelector(...)` to generate the selector
       directly rather than delegating to `dom-anchor-text-quote`. This
       gives us more control over how quote selectors are generated and more
       easily change factors such as the amount of context included.
    2a1e14c9
Name
Last commit
Last update
.github Loading commit data...
bin Loading commit data...
dev-server Loading commit data...
docs Loading commit data...
embedding-examples Loading commit data...
images Loading commit data...
scripts Loading commit data...
src Loading commit data...
.babelrc Loading commit data...
.dockerignore Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.prettierignore Loading commit data...
.prettierrc Loading commit data...
.python-version Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Dockerfile Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
codecov.yml Loading commit data...
gulpfile.js Loading commit data...
package.json Loading commit data...
requirements-dev.in Loading commit data...
tox.ini Loading commit data...
yarn.lock Loading commit data...