set context size?

16 views
Skip to first unread message

Sass Bálint

unread,
Feb 21, 2022, 12:13:33 PM2/21/22
to no...@sketchengine.co.uk
Dear All,

I'd like to save some of my concordances
together with quite large contexts (100-200-300 words).

I wasn't able to find where can I adjust the context size in the GUI.

So, where can I set the context size I need?

Thank you,
Bálint Sass
PhD, research fellow
Research Centre for Linguistics, Institute for Lexicology
http://www.nytud.hu/depts/corpus/Sass_Balint.html

Michal Cukr | Sketch Engine Support

unread,
Feb 22, 2022, 12:18:39 AM2/22/22
to no...@sketchengine.co.uk, jo...@nytud.hu
Dear Bálint,

Please go to the View options and turn on "Show more context" as you can see on this page https://www.sketchengine.eu/news/more-concordance-context/ This extends the displayed context to 100 characters on the left and right.

To set up a longer context, you need to change the setting in the registry file of your corpus. See this page https://www.sketchengine.eu/documentation/corpus-configuration-file-all-features/ with a corpus configuration. You can extend the default context size (which is 100 characters on the left and right + up to 100 characters within KWIC) by adding/changing the feature MAXCONTEXT which sets the size of the context.

Best regards,

Michal Cukr 


--
Sketch Engine Team
Email: sup...@sketchengine.eu
Boot Camp Online – a course in mastering Sketch Engine https://www.sketchengine.eu/bootcamp/

Michal Cukr | Sketch Engine Support

unread,
Feb 23, 2022, 12:43:10 AM2/23/22
to no...@sketchengine.co.uk, jo...@nytud.hu
Dear Bálint,

My colleague informed me that adding/changing the value of MAXCONTEXT in the registry file of your corpus will not affect the context size that can be saved.
If you need to extend the left and right context of your concordance results for saving, please open the following file:
app/src/concordance/ConcordaStore.js.
and change values on these lines:
data.kwicleftctx = "100#"
data.kwicrightctx = "100#"

The default values are 100 which means up to 100 tokens on the left and right.

Sass Bálint

unread,
Feb 23, 2022, 11:39:01 AM2/23/22
to no...@sketchengine.co.uk
Dear Michal,

Thank you for your help. :)

1.
As I have command line access, the solution I find most convenient is:
$ corpquery CORPUS_CONFIG 'CQL_QUERY' -a word -c NUMBER_OF_CONTEXT_TOKENS

2.
Your proposed solution based on ConcordaStore.js is suboptimal,
as it needs to be changed every time in source code
and it affects the GUI which may be used by other users in the meantime.

Anyway, I found and changed the two variables in
/var/www/crystal/bundle.js in the installed NoSkE.
I tested it, and it works, thanks.
A remark: data.kwicleftctx = "100#" means 100 chars, not tokens.

3.
Setting `MAXCONTEXT 100` in corpus config file,
did not lead to any results for me.
Should I maybe recompile the corpus for this setting to take effect?

4.
Once upon a time
[Sketch Engine (ver:open-2.59.1-open-2.91.13)]
there was a possibility to set the context
to a given number of chars in the GUI
at "View options" / "KWIC Context size".
What about bringing back this functionality? :)

Thank you again!

Best,
Bálint Sass

Michal Cukr | Sketch Engine Support

unread,
Feb 23, 2022, 12:14:46 PM2/23/22
to no...@sketchengine.co.uk, jo...@nytud.hu
Dear Bálint,

With regard to your points:

2. You're right! That was my mistake. Thank you for your remark.
3. MAXCONTEXT isn't supported now, and that's why my colleague pointed me out to the solution via ConcordaStore.js Anyway, it should be supported again.
4. We discussed this option in relation to your first query about context size and probably we'll get it back to the interface. Only I'm not sure if it appears in the next version of NoSkE (which comes, hopefully, soon, my colleague informed me that it is almost ready to release -- I know we said it two months ago, but still, some things needed to be done in that time).
Reply all
Reply to author
Forward
0 new messages