Hoppa till huvudinnehåll

Korp frontend 9.11

Inlagt av Arild Matsson 2025-09-11

In a lucky coincidence, the new version number of the Korp frontend is the same as its release date (if you choose to write it so). The relase mainly boasts large refactoring efforts, but let's take a look at user-facing improvements before diving into the code side of things.

User interface changes

Korp frontend 9.10Korp frontend 9.11

The KWIC Sidebar, shown when you select a token in the search result, now reads more clearly. The attribute labels are bolded and values are indented. Attributes with no value are shown as the ∅ (empty set) symbol. Plus, the dependency tree button in the bottom is now adorned with an icon.

The Word Picture, a syntactic-semantic visualization feature, works with any search of a single word or lemgram. Previously, it would only consider queries made using the Simple search mode. However, it is equally possible to make compatible queries from the Extended or Advanced search mode, so now we accept those too.

The JSON button in result views now downloads the data from your original request instead of making a new one. This avoids waiting for another request, though the file may sometimes include a bit of temporary progress information.

Finally, the ex-raven that accompanies error messages has been revamped (although not revived).

Under the hood

In software terms, the Korp frontend is quite an old and experienced being. Ongoing is an effort to renew the code, to ensure it lives on as long as it is wanted. These are some of the changes that were made in this version to improve the codebase:

Core/UI separation

An important upgrade will be to stop relying on the discontinued web framework AngularJS. For this to be possible, framework-dependent code ("UI") needs to be minimized and separated from independent code ("Core"). For instance, instead of keeping data processing in an AngularJS component, it can be extracted to separate file. The new file doesn't need any dependency on the framework, and can remain while the AngularJS library is eventually stripped from the project. For this release, I have systematically gone through all the code and tried to do this separation as extensively as possible.

Circular dependencies

Circular dependencies between code files don't usually break things, but they tend to make future changes harder and risk introducing bugs. To find and fix them, I have mostly been using Dependency cruiser. I have also tried Madge, which is easier to use but has less fancy graphical output.

Peggy loader

The CQP parser is written in Peggy grammar. Before, every change required manually running a command to convert it to JavaScript and committing both files. Now we use a third-party Webpack Peggy loader to load it at build time.

Etiketter