• 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
..
annotator Loading commit data...
boot Loading commit data...
images/icons Loading commit data...
shared Loading commit data...
sidebar Loading commit data...
styles Loading commit data...
test-util Loading commit data...
types Loading commit data...
.eslintrc Loading commit data...
karma.config.js Loading commit data...
tsconfig.json Loading commit data...