INL / corpus-frontend

BlackLab Frontend, a feature-rich corpus search interface for BlackLab.
16 stars 7 forks source link

Using indexed sentences, also the "Punct" field #445

Closed stcoats closed 1 year ago

stcoats commented 1 year ago

Hello again! Sorry for opening yet another issue -- let me know if it is better to keep everything within one issue.

I don't understand why the "Punct" column is appearing in my frontend. It doesn't seem to correspond to anything in my blf.yaml, and I can't find information about it otherwise on the blacklab site. Could you tell me what this is and how to get rid of it?

image

My second question has to do with sentences. Say I have a structure like this:

(other stuff)
<p>
<s n="109" file="myfile.wav">
<w xml:id="w.2206" pos="RB" lemma="certainly">certainly</w>
<w xml:id="w.2207" pos="VB" lemma="perform">perform</w>
<w xml:id="w.2208" pos="IN" lemma="for">for</w>
<w xml:id="w.2209" pos="DT" lemma="a">a</w>
<w xml:id="w.2210" pos="NN" lemma="couple">couple</w>
<w xml:id="w.2211" pos="IN" lemma="of">of</w>
<w xml:id="w.2212" pos="NNS" lemma="hour">hours</w>
</s>
</p>
(etc.)

The myfile.wav represents a file on a CDN in which all the words in this sentence are spoken. Can I configure the frontend so that instead of the "Punct" field (for example), I show a link to this file and/or a button to play this file?

KCMertens commented 1 year ago

Punct is how BlackLab stores punctuation internally, i.e. whitespace and stuff in between and after words.

By default the frontend shows the first 3 available fields, but it seems punct isn't filtered out of them, that's a bug actually!

To remove it you'll have to create a config for your corpus. See the readme The simplest way is to copy the default search.xml, uncomment the PropColumns line and change it to something like lemma, pos to only show those two as extra columns.

stcoats commented 1 year ago

Thanks, that works! Punct keeps showing up, for example here:

image

How do I remove it there and anywhere else it might appear?

KCMertens commented 1 year ago

Call vuexModules.ui.actions.results.shared.detailedAnnotationIds(['word', 'lemma', 'pos']) from javascript. Add only those annotations (those in the property column in your screenshot) you want to show.

stcoats commented 1 year ago

Great, that worked!