* pre-calculate inbound similarities
* only pre-calculate similarities for nodes that have many inbound links
* tweak dark theme
* parallel inbound pre-calculation
* use image link instead of base64 embedded to lower serp size.
* embed 'bm25' signal into all the 'bm25_*' signals. The math should be equivalent and prevents us calculating the same signals twice.
* remove proximity ranking signals as they were disabled. Need to figure out how to make them faster.
* faster snippet generation by first trying to generate snippet without stemming. This will succeed in most results and is vastly faster.
This allows us to short circuit the query when we have reached max_docs_considered at the query level instead of at the collector level. This should increase search performance since the searcher then doesn't have to iterate all the results in order to return a count.
In practice we probably always want to count the results when calling the api from the frontend, but it's a nice performance parameter we can flip if we need to squeeze every drop of performance from the backend at some point. We also only count the results for api requests that needs the count.
The thesaurus widget is powered by a openwordnet RDF format. This should make it very easy to add more languages when we want to.
Phrase searches triggered a string function in fend which caused the calculator to show up. The y-combinator function caused a stack overflow due to the recursion. Both of these bugs have now been fixed.
The old version of `EntityIndex::best_info` manipulated the text of
spans without alterting the associated link offsets. To do this would
be convoluted when having to consider '•', so instead we do not replace
'*' with '•' any longer, but only strip the prefix of '*' and whitespace
and then subtract the removed prefix length from all link offsets. When
rendering the snippets on the frontend, we perform the '*' replacement
since the index have been made into snippets and the text is thus free
to change.
* Run `npm run format`
* Remove two instances of @ts-ignore by defining the locals in app.d.ts
* Align icons on Manage Optics page
The eye was centered vertically, while the minus was aligned to the top.
This puts them both at the top.
A lot of places where we use icons they are quite small, so it is
preferable to use the mini aka 20x20 solid variants for readability.
Most of the changed icons were already solid, but the following were
changed from outline to solid:
- Callout icons
- Discussion chat bubble
* Refactor entity code
This commit is an amalgamation of many changes of varying size (that
should have been multiple commits, sorry):
- `WikiNodeExt` for convenience methods on `Node`s
- Make `Link` offsets byte-oriented rather than char-oriented
- Make `Span::add_link` compute the link offsets internally
- Add `Span::add_node` shared by the `From<[Node]>` and `EntityBuilder`
methods
- Refactor `EntityIterator` by using the `Deref` impl on
`quick_xml::Event`
- Move `EntityBuilder` extraction methods out to take a shared `&[Node]`
instead of re-parsing each.
- These extraction methods have been refactored to use iterators more
heavly and wild-cards in matching
- Add an, early-stage, `render_template` for rendering certain Wiki
specific templates such as pronunciations
- Refactor `maybe_prettify_entity_date` and `entity_link_to_html`
- Add expect testing to `EntityBuilder` with a debug Wiki renderer
* Use `quick_xml` `name()` in `EntityIterator`
Turns out the `Deref` impl on `Event` gives all bytes and not just the
name of the event. Instead we now extract the name so we can use it in
the match arms.
* Handle `respell` templates
* Handle `Node::ParagraphBreak` during entity rendering
When a `ParagraphBreak` is encountered a `\n` is inserted. This may or may not be appropriate for the place it's rendered. In HTML I think this
will result in a since place, which would be good, but I haven't tested
just yet.
* Handle potentially empty `Node::Template` name
* Document and move `render_template` to mod scope
* Documnet `check_abstract`
* Use a snippet structure for entity rendering instead of HTML
This is an inprogress commit, that currently has bincode issues
* Build 'DisplayedEntity' on the api server.
This avoids the issues we have with tagged enums in bincode, while wanting camelCase naming for the public API. It also has the added side-benefit of keeping the internal API more clean as all 'Displayed*' now gets constructed right before they hit the public facing endpoints.
* Fix entity info spacing between links
* Change entity snippet links to underline on hover instead of color
* Include fr-IPA wiki template
---------
Co-authored-by: Mikkel Denker <mikkel@trystract.com>
* Add multiple themes
* Remove some unused tailwind colors
* Theming for explore "Show more" chevron
* Make `Select` component generic
* Run format
* Optimze frontpage and header logo
* Unnest styling from `.code-sample`
* Add very basic fallback error page
* Refactor Select component
It now uses an options array to better track the real values of the
options instead of relying on stringed values.
The new API is both more ergonomic and more correct!
Closes#100
* Handle `undefined` in `writableLocalStorage` better
When the inserted value is `undefined`, remove the value rather than
inserting `undefined`, which caused subsequent `JSON.parse` to crash
* Tweak the light themes
* Move theme select into settings