Displaying structure-attributes in KWIC?

26 views
Skip to first unread message

H Pirker

unread,
Nov 10, 2023, 2:20:32 PM11/10/23
to NoSketch Engine
Dear Wizards of NoSke 

is there a way to not only display STRUCTURE-tags but also their  ATTRIBUTES in a concordance view? 

I have a corpus that was derived from TEI/XML, i.e. I ended with 140(!) different STRUCTURE tags in my registry file - and for many of these,  relevant information is encoded in structure-ATTRIBUTES. So obviously the researchers working with the data would be  keen to be able to actually see the full markup, complete with  attributes.  

hopeful greetings :-) 

Hannes

H Pirker

unread,
Nov 10, 2023, 3:24:01 PM11/10/23
to NoSketch Engine, H Pirker
uups, sorry.  Reading the manual beforehand actually is a good idea :-( 
 I only now  noticed the option for   `DISPLAYBEGIN` in   https://www.sketchengine.eu/documentation/corpus-configuration-file-all-features/#Controllingconcordances

This almost  does the job

I wanted to have some STRUCTURE-attributes displayed in 1:1 "XML-Style". 
I.e. ideally I would like to see  something like  `<HYPH1 cont="Haussegen">Haus-</HYPH1>`

I tried: 
...
DISPLAYBEGIN "<HYPH1 cont=%(cont)>"
DISPLAYEND "</HYPH1>"

This results in a `<HYPH1cont=Haussegen>Haus-</HYPH1>` 
i.e. the attribute name ("cont")  is directly concatenated to the element name without a space. 
And  I did not see an option to place quotes around the attribute value. 
Any hints on that? 
(I admit, this is more about "aesthetics" - the main issue is solved !)
 
cheers

Hannes 

H Pirker

unread,
Nov 10, 2023, 4:04:55 PM11/10/23
to NoSketch Engine, H Pirker
... and one more remark: my first impression is, that by default all whitespaces are stripped from the DISPLAYBEGIN-pattern? 
This makes it more than a simple "aesthetic" issue - because the attributes becomes difficult  when there more of them and some of them can even be empty.
I.e. 
DISPLAYBEGIN "<DIV_START author=%(author) cat=%(cat) type=%(type)/>" 

will end up like  <DIV_STARTauthor=someauthorcat=type=sometype/>
Any hint on how to add "preserved whitespace" to the pattern?

Thanks a lot 

Hannes

Tomaž Erjavec

unread,
Nov 10, 2023, 4:09:20 PM11/10/23
to no...@sketchengine.co.uk

Hi,

let me add my voice here too: that whitespace is stripped from DISPLAYBEGIN or DISPLAYEND is indeed vexing, and because of this many otherwise nice DISPLAY directives become ugly in less useful. I've been meaning to ask about this for a while now, and maybe this is a good opportunity!

Best,

Tomaž

--
You received this message because you are subscribed to the Google Groups "NoSketch Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to noske+un...@sketchengine.co.uk.
To view this discussion on the web visit https://groups.google.com/a/sketchengine.co.uk/d/msgid/noske/4913c8cc-1552-4648-a67e-a7864da0eb60n%40sketchengine.co.uk.

Vojtěch Kovář

unread,
Nov 15, 2023, 4:11:14 PM11/15/23
to Tomaž Erjavec, H Pirker, no...@sketchengine.co.uk
Dear Hannes and Tomaž,

thank you for bringing this up -- indeed all the whitespace is stripped from DISPLAYBEGIN and DISPLAYEND which is a bug that we will fix ASAP and release a new version of NoSkE Crystal. In the meanwhile, it can be bypassed by using a non-whitespace character that looks like whitespace, e.g. U+2800 BRAILLE PATTERN BLANK with which I was able to put the "whitespace" into the DISPLAYBEGIN :)

Also, quotes can be put into the DISPLAYBEGIN value by using apostrophes instead of the outer quotes, like this:

DISPLAYBEGIN '<HYPH1 cont="%(cont)">'

And last but not least, we are working on an update that will enable users to turn on/off structure attributes by themselves (i.e. without DISPLAYBEGIN) -- it will be available in concordance view options, under "structures". If everything goes well, this will be part of the next NoSkE release as well as the fix mentioned above.

We will let you know when it's ready.

All the best,

Vojtech


Reply all
Reply to author
Forward
0 new messages